PikMike

Untitled

Mar 13th, 2016
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.86 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. #define pb push_back
  4. #define pf push_front
  5. #define mp make_pair
  6. #define sz size
  7. #define ll long long
  8. #define ld long double
  9. #define fs first
  10. #define sc second
  11. #define forn(i, f, t) for(int i = f; i < t; i++)
  12. #define all(x) (x).begin(), (x).end()
  13. #define ins insert
  14.  
  15. const int INF = 2147483647;
  16. const int MOD = 1000000007;
  17. const ll INF64 = 9223372036854775807;
  18. const ld EPS = 1e-7;
  19.  
  20. using namespace std;
  21.  
  22. map<string, int> a;
  23.  
  24.  
  25. int main(){
  26.     cin.tie(nullptr);
  27.     ios_base::sync_with_stdio(false);
  28.     int n;
  29.     string s;
  30.     vector<pair<int, string> > b;
  31.     cin >> n;
  32.     forn(i, 0, n){
  33.         cin >> s;
  34.         a[s] = i;
  35.     }
  36.     for (auto it = a.begin(); it != a.end(); it++) b.pb(mp(it->sc, it->fs));
  37.     sort(all(b));
  38.     for (int i = (int)b.sz() - 1; i >= 0; i--) cout << b[i].sc << "\n";
  39.     return 0;
  40. }
Add Comment
Please, Sign In to add comment