Pagini recente » Cod sursa (job #1631151) | Cod sursa (job #505821) | Diferente pentru summer-challenge-2021/solutii intre reviziile 10 si 9 | Cod sursa (job #1520242) | Cod sursa (job #2615658)
with open("hashuri.in", "r") as fin:
n = int(fin.readline())
dct = {}
with open("hashuri.out", "w") as fout:
for i in range(n):
op, x = list(map(int, fin.readline().split(" ")))
if op == 1:
dct[x] = 1
elif op == 2:
try:
dct.pop(x)
except KeyError:
continue
else:
try:
if dct[x] == 1:
fout.write("1\n")
except KeyError:
fout.write("0\n")