Pagini recente » Cod sursa (job #1516190) | Cod sursa (job #482019) | Cod sursa (job #1171201) | Cod sursa (job #979172) | Cod sursa (job #2615657)
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 = [int(s) for s in fin.readline().split(" ")]
if op == 1:
try:
if dct[x] == 1:
continue
except KeyError:
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")