Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

20 lines
362B

  1. import itertools
  2. import sys
  3. from intcode import compute, parse
  4. def check(noun, verb):
  5. ns = parse(text)
  6. ns[1] = noun
  7. ns[2] = verb
  8. list(compute(ns, 2))
  9. return ns[0]
  10. text = sys.stdin.read()
  11. print(check(12, 2))
  12. for noun, verb in itertools.product(range(100), repeat=2):
  13. if check(noun, verb) == 19690720:
  14. print(100 * noun + verb)