Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main () {
- ios::sync_with_stdio(false);
- cin.tie(nullptr);
- cout.tie(nullptr);
- //~ set<int> st;
- //~ st.insert(3);
- //~ st.insert(3);
- //~ st.insert(1);
- //~ st.insert(2);
- //nlog(n)
- //1 2 3
- //~ for (auto x : st) {
- //~ cout << x << ' ';
- //~ }
- //~ for (auto it = st.begin(); it != st.end(); it++) {
- //~ cout << *it << ' ';
- //~ }
- int n;
- cin >> n;
- set<int> st;
- for (int i = 0; i < n; ++i) {
- int x;
- cin >> x;
- st.insert(x);
- }
- cout << (int) st.size() << '\n';
- }
- //oj link : https://cses.fi/
- //problem link : https://cses.fi/problemset/task/1621
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement