parent
a17271dea2
commit
a152cec986
1 changed files with 29 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) |
Loading…
Reference in new issue