Cod sursa(job #247056)

Utilizator wickedmanCristian Strat wickedman Data 22 ianuarie 2009 02:14:39
Problema Hashuri Scor 40
Compilator py Status done
Runda Arhiva educationala Marime 0.32 kb
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))