Pagini recente » Cod sursa (job #1296397) | Istoria paginii runda/wellcodesimulareclasa11-12-10martie | Cod sursa (job #1523543) | Cod sursa (job #1900139) | Cod sursa (job #247056)
Cod sursa(job #247056)
lines = open("hashuri.in", "r").readlines()
fd_out = open("hashuri.out", "w")
hash = set()
for line in lines[1:]:
op, key = map(int, line.split(" "))
has_key = key in hash
if op == 1 and not has_key:
hash.add(key)
elif op == 2 and has_key:
hash.remove(key)
elif op == 3:
fd_out.write("%d\n" % int(has_key))