为什么我们必须分别使用d [0]和d [1]而不是另一个input()命令?
n = int(input())
s = set(map(int, input().split()))
N = int(input())
for i in range(N):
d = input().split()
if d[0] =="pop":
s.pop()
elif d[0] == "remove":
s.remove(int(d[1]))
elif d[0] == "discard":
s.discard(int(d[1]))
print(sum(s))