import sys N = int(sys.stdin.readline()) D = {} for _ in range(N): string = sys.stdin.readline().strip() if len(string.split()) == 2: t, c = map(int, string.split()) flag = True for k in range(t-30, t+31): if k in D.keys(): flag = False break if flag == False: continue else: if t in D.keys(): D[t] += c else: D[t] = c elif int(string) == -1: if not D: print('skipped') else: print(D[min(D.keys())]) D.pop(min(D.keys())) else: t = int(string) if t in D.keys(): print(D[t]) else: print(0)
全部评论
(1) 回帖