Advertisement
Saleh127

UVA 484

Sep 21st, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define test int t; cin>>t; for(int cs=1;cs<=t;cs++)
  5. int main()
  6. {
  7. ios_base::sync_with_stdio(0);
  8. cin.tie(0);cout.tie(0);
  9.  
  10. ll d,i,j,k,l;
  11. vector<ll>a;
  12. map<ll,ll>c;
  13.  
  14. while(cin>>d)
  15. {
  16. if(c[d]==0)
  17. {
  18. a.push_back(d);
  19. c[d]=1;
  20. }
  21. else
  22. {
  23. c[d]++;
  24. }
  25. }
  26. for(i=0;i<a.size();i++)
  27. {
  28. cout<<a[i]<<" "<<c[a[i]]<<endl;
  29. }
  30.  
  31. return 0;
  32. }
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement