Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
402 B
0
Indexable
Never
#include <bits/stdc++.h>
using namespace std;


int main()
{
    long long n,c=0,dem[1000]={0},xmax=0;
    cin >> n;
    long long a[205];

    for (int u = 0; u < n; u++)
    {
        cin >> a[u];
        dem[a[u]]++;
        if (xmax<a[u]) xmax=a[u];
    }
        for (int u=0; u<=xmax; u++ )
        {
         if (dem[u]!=0)c++;
        }
     cout << c;

    return 0;
}
Leave a Comment