SDJ( 수돈재 아님 ㅎ )

[C++] 7785 - 회사에 있는 사람 본문

알고리즘/Backjoon

[C++] 7785 - 회사에 있는 사람

ShinDongJun 2019. 12. 5. 11:34
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <bits/stdc++.h> 
#include<iostream>
#include<map>
#include<utility>
#include<algorithm>
#include<set>
#include<string>
#define endl '\n';
 
using namespace std;
 
set<string> s;
 
int main(void)
{
    ios_base :: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
 
    int n;
    string name;
    string log;
    cin >> n;
 
    for(int i = 0; i < n; ++i)
    {
        cin >> name    >> log;
        if(!log.compare("enter"))
            s.insert(name);
        else
            s.erase(name);
        
    }
 
    for(set<string>::reverse_iterator iter = s.rbegin(); iter != s.rend(); ++iter)
        cout << *iter << endl;
 
    return 0;
}

'알고리즘 > Backjoon' 카테고리의 다른 글

[C++] 10865 - 친구 친구  (0) 2019.12.07
[C++] 2798 - 블랙 잭  (0) 2019.12.06
[C++] 2156 - 포도주 시식  (0) 2019.12.05
[C++] 1904 - 01타일  (0) 2019.12.05
[C++] 1003 - 피보나치 함수  (0) 2019.12.04
Comments