You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 satır
286B

  1. import sys
  2. def bin(string, trans=str.maketrans('FBLR', '0101')):
  3. return int(string.translate(trans), 2)
  4. sids = {bin(ln[:7]) * 8 + bin(ln[7:]) for ln in sys.stdin.read().splitlines()}
  5. ans1 = max(sids)
  6. print(ans1)
  7. ans2, = sids ^ set(range(min(sids), max(sids) + 1))
  8. print(ans2)