From 43dba6a9d5aef3368d5cba4d4753ae9c69c7a9dc Mon Sep 17 00:00:00 2001 From: Skye Date: Tue, 13 Dec 2022 16:35:30 +0900 Subject: [PATCH] you can guess --- 2pt2.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 2pt2.py diff --git a/2pt2.py b/2pt2.py new file mode 100644 index 0000000..d5a8c19 --- /dev/null +++ b/2pt2.py @@ -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) \ No newline at end of file