sfdajkl;fsdajkklj;fslj;kds
This commit is contained in:
parent
43dba6a9d5
commit
200456de89
2 changed files with 2 additions and 21 deletions
6
2.py
6
2.py
|
@ -1,6 +1,2 @@
|
|||
with open("input2_pre.txt") as f:
|
||||
s = 0
|
||||
for line in f.readlines():
|
||||
a, b = [int(a) for a in line.strip().split()]
|
||||
s += b + ((3, 0, 6)[((a - b) % 3)])
|
||||
print(s)
|
||||
print(sum([(([int(a) for a in line.strip().split()][1]) + ((3, 0, 6)[((([int(a) for a in line.strip().split()][0]) - ([int(a) for a in line.strip().split()][1])) % 3)])) for line in f.readlines()]))
|
17
2pt2.py
17
2pt2.py
|
@ -1,17 +1,2 @@
|
|||
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)
|
||||
print(sum([(({(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,}[([int(a) for a in line.strip().split()][0], [int(a) for a in line.strip().split()][1])]) + ((3, 0, 6)[((([int(a) for a in line.strip().split()][0]) - ({(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,}[([int(a) for a in line.strip().split()][0], [int(a) for a in line.strip().split()][1])])) % 3)])) for line in f.readlines()]))
|
Loading…
Reference in a new issue