alphacademy-cpp/quito/kagami.cpp

22 lines
371 B
C++
Raw Normal View History

2023-01-18 21:26:31 +00:00
#include <bits/stdc++.h>
using namespace std;
int main () {
int n;
cin >> n;
vector<int>v(n);
for (int i = 0; i < n; i++) {
cin >> v[i];
}
sort(v.begin(), v.end());
int out =1;
for (int i = 0; i < n; i++) {
if (i!=0){
if (v[i-1] != v[i]) {
out++;
}
}
}
cout<<out;
}