Cod sursa(job #2628017)
Utilizator | Data | 13 iunie 2020 22:06:56 | |
---|---|---|---|
Problema | Hashuri | Scor | 30 |
Compilator | py | Status | done |
Runda | Arhiva educationala | Marime | 0.36 kb |
with open("hashuri.in", "r") as f, open("hashuri.out", "w") as g:
n = int(next(f))
dic = {}
while n:
n -= 1
t, x = (int(i) for i in next(f).split())
if t == 1:
dic[x] = 1
elif t == 2:
if x in dic:
del dic[x]
else:
g.write("1\n" if x in dic else "0\n")