Cod sursa(job #247053)

Utilizator wickedmanCristian Strat wickedman Data 22 ianuarie 2009 02:05:36
Problema Hashuri Scor 100
Compilator py Status done
Runda Arhiva educationala Marime 0.34 kb
fd = open("hashuri.in", "r")
fd_out = open("hashuri.out", "w")
hash = dict()
for i in xrange(int(fd.readline())):
  op, key = map(int, fd.readline().split(" "))
  has_key = hash.has_key(key)
  if op == 1 and not has_key:
    hash[key] = True
  elif op == 2 and has_key:
    del hash[key]
  elif op == 3:
    fd_out.write("%d\n" % int(has_key))