← Back to List

15841번: Virus Outbreak ↗

Solutions

Python 3
156 B | 156 chars
D = [0, 1, 1]
for i in range(500):
  D.append(D[-1]+D[-2])
while 1:
  n = int(input())
  if n == -1:
    break
  print(f"Hour {n}: {D[n]} cow(s) affected")