We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0838670 commit 317692aCopy full SHA for 317692a
1 file changed
심수연/4주차/260123.py
@@ -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