Advertisement
tepyotin2

Distinct Numbers

May 25th, 2025
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int n;
  6. set<long long> val;
  7.  
  8. int main(){
  9.     //freopen("distinctnumbers.in", "r", stdin);
  10.    
  11.     cin >> n;
  12.     int v;
  13.     for(int i=0; i<n; i++){
  14.         cin >> v;
  15.         val.insert(v);
  16.     }
  17.     cout << val.size() << '\n';
  18.    
  19.     return 0;
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement