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

What's the difference btween -1 and m-1?
Posted by LNCP 7 Feb 2015 18:38
It's obvious we calculate recurrence with Matrix.But in the base Matrix,I first used -1,then I got WA#3,while I replaced it with m-1,I got AC.Who can explain it to me?

Edited by author 07.02.2015 18:44
Re: What's the difference btween -1 and m-1?
Posted by Drunken Statue 10 Feb 2016 17:26
I think you mean first used +1, not -1? -1 makes strange recurrence

If you mean +1, then makes Fibonacci sequence. But problem not Fibonacci, although similar idea.

When use m - 1 to replace +1, makes problem's recurrence