Advertisement
Eather

484

Apr 21st, 2011
496
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.14 KB | None | 0 0
  1.                            /*in the name of Allah */
  2. # include <list>
  3. # include <deque>
  4. # include <bitset>
  5. # include <algorithm>
  6. # include <functional>
  7. # include <numeric>
  8. # include <utility>
  9. # include <sstream>
  10. # include <iostream>
  11. # include <iomanip>
  12. # include <cstdio>
  13. # include <cmath>
  14. # include <cstdlib>
  15. # include <ctime>
  16. # include <set>
  17. # include <map>
  18. # include <cmath>
  19. # include <queue>
  20. # include <limits>
  21. # include <stack>
  22. # include <vector>
  23. # include <cstring>
  24. # include <cstdio>
  25. using namespace std;
  26.  
  27. # define MEM(array,w)   memset(array,w,sizeof array)
  28. # define ULL unsigned long long
  29. # define eps 1e-9
  30. # define SS stringstream
  31. # define FOR(i, a, b) for (int i=a; i<b; i++)
  32. # define REP(i, a) FOR(i, 0, a)
  33. # define rive(s) reverse(s.begin(),s.end())
  34. # define PII pair<int , int>
  35. # define MPSS map<string, string>
  36. # define MPIS map<int, string>
  37. # define MPSI map<string, int>
  38. # define MPII map<int, int>
  39. # define MPIC map<int,char>
  40. # define MPCI map<char, int>
  41. # define all(c) (c).begin(), (c).end()
  42. # define VS vector<string>
  43. # define VI vector<int>
  44. # define VC vector<char>
  45. # define VB vector<bool>
  46. # define sz(x) x.size()
  47. # define pb push_back
  48. # define STI set<int>
  49. # define STC set<char>
  50. # define STS set<string>
  51. # define OK(R,C) if(i<0 && j<0 && j==C && i==R)
  52.  
  53. template<class T> string toString(T n){ostringstream ost;ost<<n;ost.flush();return ost.str();}
  54.  
  55. int toInt(string s){int r=0;istringstream sin(s);sin>>r;return r;}
  56.  
  57. bool isprime(int n){if( n<2) return 0;for( int i=2; i*i<=n ; i++)if(n%i==0)return 0; return 1;return 0;}
  58.  
  59. int pel(string s){string t;t=s;reverse(t.begin(),t.end());if(s==t)return 1;return 0;}
  60.  
  61. char graph[100][100];
  62. bool visited[100][100];
  63. int row,col;
  64.  
  65. int dr[]={0,0,1,-1};
  66. int dc[]={1,-1,0,0};
  67. int rchange[] = {-1,0,1,-1,0,1};
  68. int cchange[] = {-1,-1,0,0,1,1};
  69.  
  70. int main()
  71. {
  72.  
  73.     int n;
  74.     map<int,int> mpi;
  75.     vector<bool>fol(0);
  76.     vector<int>pos;
  77.  
  78.     while(cin>>n)
  79.     {
  80.         mpi[n]++;
  81.  
  82.         if(fol[n]!=1)pos.pb(n);fol[n]=1;
  83.     }
  84.     for(int i=0;i<pos.size();i++)
  85.     cout<<pos[i]<<" "<<mpi[pos[i]]<<endl;
  86.     mpi.clear();pos.clear();
  87.     return 0;
  88. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement