본문 바로가기
알고리즘/백준

백준-7785번(회사에 있는 사람)-python3

by nyeongha 2023. 11. 28.
import sys

pe = {}

for _ in range(int(sys.stdin.readline())):
  p, c = sys.stdin.readline().rstrip().split()

  if c == 'enter':
    pe[p] = 'enter'
  else:
    if pe[p]:
      del pe[p]

for people in sorted(pe, reverse=True):
  print(people)

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

백준-9012번(괄호)-python3  (0) 2023.11.29
백준-8958번(OX퀴즈)-python3  (0) 2023.11.28
백준-7576번(토마토)-python3  (0) 2023.11.27
백준-7567번(그릇)-python3  (0) 2023.11.27
백준-7287번(등록)-python3  (0) 2023.11.27