This commit is contained in:
DUEFON 2022-12-05 19:24:48 +01:00 committed by Eivind Øksnevad
parent 0b729ef76e
commit c40cc64a22
2 changed files with 2517 additions and 0 deletions

2500
input2 Normal file

File diff suppressed because it is too large Load Diff

17
two.py Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env python3
from useful import *
def prd(c):
return (ord(c) - ord('A')) % 23
def scores(c):
return 1 + prd(c)
def bonus(a, b): # for b (that's us)
return [[3, 6, 0],
[0, 3, 6],
[6, 0, 3]][prd(a)][prd(b)]
rounds = [[l[0], l[2]] for l in lines(open(0))]
ic([[a, b, scores(b), bonus(a, b)] for a, b in rounds])
print(sum(scores(b) + bonus(a, b) for a, b in rounds))