code: https://ide.codingblocks.com/s/454534
problem : https://www.spoj.com/problems/SEQ/
not getting output
code: https://ide.codingblocks.com/s/454534
problem : https://www.spoj.com/problems/SEQ/
not getting output
what is the reason for doing b[i-1] instead of b[i] in line 56
in vector b , we have strored values starting from index 0.
but in f1 we are storing from 1 onwards thats why using i-1 for b
but i stored it from 1 itself , are we supposed to store from 0
no u r storing from index 0 only. check line 104, there u are using push back function becuase of that elements will be inserted from index 0 onwards
ohh okay got it now .
f(n)=f(n-1) + f(n-2)
REPLACE n with n+1
f(n+1)=f(n)+f(n-1)
why isnt it written as below in front of the transformation matrix
f(n-2)
f(n-1)
`
…
didnt get ur question.
what u r asking?
…
both are correct . . . . , both are represeting the same thing… .
its just first row become second and second row become first.
oh okay I just started this topic today so it’s a bit confusing so as long as the relation is correct we can write terms in whatever order we want
…
yeah expression must be correct. implementation will also vary accordingly.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.