Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* BISMILLAHIR-RAHMANIR-RAHIM
- ____________________________________
- | |
- | SHANTO_SUST_SWE-19_029 |
- |____________________________________|
- */
- #include <stdio.h>
- #include <string.h>
- #include <math.h>
- #include <stdlib.h>
- #include <time.h>
- #define debug 1
- int number[2000005];
- int main()
- {
- int n;
- scanf("%d", &n);
- int ara[n];
- int i, max = -1000005;
- for(i = 0; i < n; i++){
- scanf("%d", &ara[i]);
- number[ara[i] + 1000001]++;
- if(ara[i] > max){
- max = ara[i];
- }
- }
- int count = 0;
- for(i = 0; i <= 1000001 + max; i++){
- if(number[i] > 0){
- count++;
- }
- }
- printf("%d\n", count);
- return 0;
- }
- //ALHAMDULILLAH
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement