day 2 part 1

This commit is contained in:
Skye 2022-12-13 16:32:13 +09:00
parent 5827c05c07
commit b416ab805b
Signed by: me
GPG key ID: 0104BC05F41B77B8
4 changed files with 5007 additions and 0 deletions

6
2.py Normal file
View file

@ -0,0 +1,6 @@
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)

1
2_preproc.sh Normal file
View file

@ -0,0 +1 @@
cat input2.txt | sed "s/X/A/g" | sed "s/Y/B/g" | sed "s/Z/C/g" | sed "s/A/1/g" | sed "s/B/2/g"| sed "s/C/3/g" > input2_pre.txt

2500
input2.txt Normal file

File diff suppressed because it is too large Load diff

2500
input2_pre.txt Normal file

File diff suppressed because it is too large Load diff