#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ss stable_sort
#define ll long long
struct cmp {
bool operator()(const string& a, const string& b) const {
return a > b;
}
};
int main() {
cin.tie(0)->sync_with_stdio(0);
// for(int i=0; i< n;i++)
int n;
cin >> n;
vector<string> v;
set<string> se;
while (n--) {
string s, s2;
cin >> s >> s2;
if (s2 == "enter") {
se.emplace(s);
}
else {
se.erase(s);
}
}
/*for (auto i : se) {
cout << i << "\n";
}*/
for (auto it = se.rbegin(); it != se.rend(); it++) {
cout << *it<<"\n";
}
return 0;
}
'백준 풀이 C++' 카테고리의 다른 글
백준 2630 C++ (분할과 정복) (0) | 2022.09.24 |
---|---|
백준 3020 c++ (이분탐색) (1) | 2022.09.24 |
백준 2702 C++(유클리드 호제법) (0) | 2022.09.22 |
백준 15651 N과M(3) (백트래킹) (0) | 2022.09.22 |
백준 15650 N과 M(2) C++ (백트레킹) (0) | 2022.09.22 |