you can guess

This commit is contained in:
Skye 2022-12-13 16:35:30 +09:00
parent b416ab805b
commit 43dba6a9d5
Signed by: me
GPG key ID: 0104BC05F41B77B8

17
2pt2.py Normal file
View 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)