Skip to content

Commit 317692a

Browse files
committed
[BOJ] 7785 회사에 있는 사람 (S5)
1 parent 0838670 commit 317692a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

심수연/4주차/260123.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# https://www.acmicpc.net/problem/7785
2+
3+
import sys
4+
input = sys.stdin.readline
5+
6+
N = int(input())
7+
8+
company = set()
9+
10+
for _ in range(N):
11+
name, status = input().split()
12+
if status == "enter":
13+
company.add(name)
14+
elif name in company and status == "leave":
15+
company.discard(name)
16+
17+
for name in sorted(company, reverse=True):
18+
print(name)

0 commit comments

Comments
 (0)