Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<vector>
- #include<algorithm>
- #include<string>
- using namespace std;
- int main() {
- int n;
- cin >> n;
- vector<int> a(n, 0);
- for (int i = 0; i < n; i++) {
- cin >> a.at(i);
- }
- int col = 1;
- sort(a.begin(), a.end());
- for (int i = 1; i < n; i++) {
- if (a.at(i) != a.at(i - 1))col++;
- }
- cout << col << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement