This commit is contained in:
setop 2021-12-08 01:52:34 +01:00
parent 1b266b322c
commit 7cbf4495a3
4 changed files with 18 additions and 0 deletions

7
d06/d06_1.py Normal file
View File

@ -0,0 +1,7 @@
L=list(map(int,__import__("sys").stdin.read().split(",")))
for i in range(80):
L = [ (l-1) for l in L ]
n = sum( l < 0 for l in L)
L = [ l if l>=0 else 6 for l in L ]
L += [8]*n
print(len(L))

9
d06/d06_2.py Normal file
View File

@ -0,0 +1,9 @@
D ={ i:0 for i in range(9) }
for l in list(map(int,__import__("sys").stdin.read().split(","))):
D[l]+=1
for i in range(256):
D = { i-1:D[i] for i in range(9) }
D[6] += D[-1]
D[8] = D[-1]
del D[-1]
print(sum(D.values()))

1
d06/input Normal file
View File

@ -0,0 +1 @@
1,1,1,1,1,1,1,4,1,2,1,1,4,1,1,1,5,1,1,1,1,1,1,1,1,1,1,1,1,5,1,1,1,1,3,1,1,2,1,2,1,3,3,4,1,4,1,1,3,1,1,5,1,1,1,1,4,1,1,5,1,1,1,4,1,5,1,1,1,3,1,1,5,3,1,1,1,1,1,4,1,1,1,1,1,2,4,1,1,1,1,4,1,2,2,1,1,1,3,1,2,5,1,4,1,1,1,3,1,1,4,1,1,1,1,1,1,1,4,1,1,4,1,1,1,1,1,1,1,2,1,1,5,1,1,1,4,1,1,5,1,1,5,3,3,5,3,1,1,1,4,1,1,1,1,1,1,5,3,1,2,1,1,1,4,1,3,1,5,1,1,2,1,1,1,1,1,5,1,1,1,1,1,2,1,1,1,1,4,3,2,1,2,4,1,3,1,5,1,2,1,4,1,1,1,1,1,3,1,4,1,1,1,1,3,1,3,3,1,4,3,4,1,1,1,1,5,1,3,3,2,5,3,1,1,3,1,3,1,1,1,1,4,1,1,1,1,3,1,5,1,1,1,4,4,1,1,5,5,2,4,5,1,1,1,1,5,1,1,2,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,5,1,1,1,1,1,1,3,1,1,2,1,1

1
d06/sample Normal file
View File

@ -0,0 +1 @@
3,4,3,1,2