parent
243450c38b
commit
cd56f9ba43
3 changed files with 31 additions and 0 deletions
@ -0,0 +1,29 @@ |
|||||||
|
fish = [int(i) for i in open("input.txt", 'r').read().split(",")] |
||||||
|
fishies = {} |
||||||
|
newFishies = {} |
||||||
|
|
||||||
|
for i in range(9): |
||||||
|
fishies[i] = 0 |
||||||
|
newFishies[i] = 0 |
||||||
|
|
||||||
|
for f in fish: |
||||||
|
fishies[f] += 1 |
||||||
|
|
||||||
|
for i in range(int(input("days: "))): |
||||||
|
tempFish = fishies.copy() |
||||||
|
fishies[6] = fishies[0]+newFishies[0] |
||||||
|
for j in range(6): |
||||||
|
fishies[j] = tempFish[j+1] |
||||||
|
foo = tempFish[0] |
||||||
|
tempFish = newFishies.copy() |
||||||
|
newFishies[8] = foo + newFishies[0] |
||||||
|
for j in range(8): |
||||||
|
newFishies[j] = tempFish[j+1] |
||||||
|
|
||||||
|
summa = 0 |
||||||
|
for x in fishies: |
||||||
|
summa += fishies[x] |
||||||
|
for x in newFishies: |
||||||
|
summa += newFishies[x] |
||||||
|
|
||||||
|
print(summa) |
@ -0,0 +1 @@ |
|||||||
|
4,1,1,4,1,2,1,4,1,3,4,4,1,5,5,1,3,1,1,1,4,4,3,1,5,3,1,2,5,1,1,5,1,1,4,1,1,1,1,2,1,5,3,4,4,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,5,1,1,1,4,1,2,3,5,1,2,2,4,1,4,4,4,1,2,5,1,2,1,1,1,1,1,1,4,1,1,4,3,4,2,1,3,1,1,1,3,5,5,4,3,4,1,5,1,1,1,2,2,1,3,1,2,4,1,1,3,3,1,3,3,1,1,3,1,5,1,1,3,1,1,1,5,4,1,1,1,1,4,1,1,3,5,4,3,1,1,5,4,1,1,2,5,4,2,1,4,1,1,1,1,3,1,1,1,1,4,1,1,1,1,2,4,1,1,1,1,3,1,1,5,1,1,1,1,1,1,4,2,1,3,1,1,1,2,4,2,3,1,4,1,2,1,4,2,1,4,4,1,5,1,1,4,4,1,2,2,1,1,1,1,1,1,1,1,1,1,1,4,5,4,1,3,1,3,1,1,1,5,3,5,5,2,2,1,4,1,4,2,1,4,1,2,1,1,2,1,1,5,4,2,1,1,1,2,4,1,1,1,1,2,1,1,5,1,1,2,2,5,1,1,1,1,1,2,4,2,3,1,2,1,5,4,5,1,4 |
@ -0,0 +1 @@ |
|||||||
|
3,4,3,1,2 |
Loading…
Reference in new issue