Recursive Sequence Runtime Error on online ide
You’re sitting in a room of a house which is locked from outside and calling for help.
Give proper link of the question
1 Like
-
if(n <= k) { cout << b[n-1] <<"\n"; return 0; }
Changereturn 0;tocontinue; -
vector<vector <ll> > T(k+1 , vector<ll> (k+1 , 0));
Here T is initialised to store values fromT[0][0]toT[k][k], But infor(int i = 1 ; i <= k ;i++ ){ T[i][i+1] = 1; T[k][i] = c[k-i]; }, you’re doingT[i][i+1]even wheni=k, so it is accessingT[k][k+1]which hasn’t been initialised.
So you need to dovector<vector <ll> > T(k+1 , vector<ll> (k+2 , 0));
And Boom!
Thank you 

Anytime……