ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1012. K-based Numbers. Version 2

RE1 using Py 3.6
Posted by PrankMaN 8 May 2020 02:11
My code:
n, k = map(int, input().split())
zero = [0, k - 1]
one = [0, 0]
for i in range(2, n + 1):
    zero.append((zero[i - 1] + one[i - 1]) * (k - 1))
    one.append(zero[i - 1])
print(zero[n] + one[n])

It passes all tests I can come up with on local machine but gets RE1 and I can't get what's the problem, help pls.
Re: RE1 using Py 3.6
Posted by urmat 21 Aug 2020 13:38
you should change first line of code to n = input(), k = input()