Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- #include <map>
- using namespace std;
- map<int, int> mp;
- int main() {
- int n;
- scanf("%d", &n);
- while(n--) {
- int x;
- scanf("%d", &x);
- if(x != 0) {
- mp[x]++;
- }
- }
- printf("%lu\n", mp.size());
- return 0;
- }
Add Comment
Please, Sign In to add comment