What's wrong with my code for problem 1853B — Fibonaccharsis

Revision en1, by _Spongey, 2023-12-25 22:46:32

So, My approach was to find the first two numbers they are fibbonachi like for example 6, 8, 14, 22 let's call the first number n, and the second n... then the sequence is: n, m, n+m, n+2m...

My code 238882947 So I basically found the sequence of ns and ms k'th index (K is the length of the sequence given) and made a for loop to get every possible number that works for this solution it worked right for most test cases (In test#1 lol) and printed out the correct first and second numbers of the sequence

Tags dp, solution, wrong answer, help

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English _Spongey 2023-12-25 22:46:32 588 Initial revision (published)