1

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

 8 months ago
source link: https://codeforces.com/blog/entry/123808
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

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

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


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK