Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits\stdc++.h>
- using namespace std;
- int main()
- {
- long long n;
- scanf("%lld", &n);
- long long a[n], i, j, c = 0;
- for(i = 0; i < n; i++) scanf("%lld", &a[i]);
- sort(a, a+n);
- //for(i = 0; i < n; i++) printf("%lld ", a[i]);
- for(i = 0; i < n; i++)
- {
- if(a[i] != 0 && a[i] != a[i+1]) c++;
- }
- printf("%lld\n", c);
- }
Advertisement
Add Comment
Please, Sign In to add comment