you can guess
This commit is contained in:
parent
b416ab805b
commit
43dba6a9d5
1 changed files with 17 additions and 0 deletions
17
2pt2.py
Normal file
17
2pt2.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
with open("input2_pre.txt") as f:
|
||||
s = 0
|
||||
for line in f.readlines():
|
||||
a, b = [int(a) for a in line.strip().split()]
|
||||
b = {
|
||||
(1, 1): 3,
|
||||
(1, 2): 1,
|
||||
(1, 3): 2,
|
||||
(2, 1): 1,
|
||||
(2, 2): 2,
|
||||
(2, 3): 3,
|
||||
(3, 1): 2,
|
||||
(3, 2): 3,
|
||||
(3, 3): 1,
|
||||
}[(a, b)]
|
||||
s += b + ((3, 0, 6)[((a - b) % 3)])
|
||||
print(s)
|
Loading…
Reference in a new issue