Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define pb push_back
- #define pf push_front
- #define mp make_pair
- #define sz size
- #define ll long long
- #define ld long double
- #define fs first
- #define sc second
- #define forn(i, f, t) for(int i = f; i < t; i++)
- #define all(x) (x).begin(), (x).end()
- #define ins insert
- const int INF = 2147483647;
- const int MOD = 1000000007;
- const ll INF64 = 9223372036854775807;
- const ld EPS = 1e-7;
- using namespace std;
- map<string, int> a;
- int main(){
- cin.tie(nullptr);
- ios_base::sync_with_stdio(false);
- int n;
- string s;
- vector<pair<int, string> > b;
- cin >> n;
- forn(i, 0, n){
- cin >> s;
- a[s] = i;
- }
- for (auto it = a.begin(); it != a.end(); it++) b.pb(mp(it->sc, it->fs));
- sort(all(b));
- for (int i = (int)b.sz() - 1; i >= 0; i--) cout << b[i].sc << "\n";
- return 0;
- }
Add Comment
Please, Sign In to add comment