1621 - Distinct Numbers
28 Jan 2021 — Tags: None
Click to show code.
using namespace std;
using vi = vector<int>;
int main(void)
{
int n;
cin >> n;
vi x(n);
for (auto &xi : x)
cin >> xi;
sort(x.begin(), x.end());
cout << distance(x.begin(), unique(x.begin(), x.end())) << endl;
return 0;
}