#include <stdio.h>

int f[1000010];

int main() {
    int n, presenca = 0;
    scanf("%d", &n);

    int v[n];
    
    for(int i=0; i<n; i++){
        scanf("%d", &v[i]);
    }

    for(int i=0; i<n; i++){
        f[v[i]]++;
        }
    for(int j=0; j<1000010; j++){
        if(f[j] != 0){
            presenca++;
        }
    }
    printf("%d", presenca);
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: