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 1013. K-based Numbers. Version 3

is N<=18?
Posted by begi 6 May 2015 20:48
If N=10^18 "digits" then complexity can be too big.
Also I didn't quite understand the logic of mod M, if the test is 2 10 5: then correct answer is 0, if the test is 2 10 13, then correct answer is 3 {10, 11, 12}?
Re: is N<=18?
Posted by raven 10 Jan 2016 01:02
Thank you!
Your test case helped me getting an AC.
Re: is N<=18?
Posted by Drunken Statue 16 Feb 2016 18:14
No. N=10^18 is correct

If use recurrence to calculating n = 1 then n = 2 then n = 3 etc then complexity too big

But there is shortcut to make exponential jumps in calculating (hint: matrix)