You are viewing a single comment's thread. Return to all comments →
I tried using an integer vector with the same approach. The only difference being
vector int a(n+1);
long int *a=new long intN+1;
It did not work. Wrong answer on TCs 5 to last.
The same happened on using long int vector instead of int.
Could somebody enlighten me as to why?
int vs long int?, overflow then
No, I used vectors of both int and long int and they both didn't work.
The dynamic array worked.
Yeah,the same happened to me.
Dint get it.
wrong logic maybe, the answer at the top doesnt let things grow too big if possible though
No, the logic couldn't have been the problem since I changed nothing in the code but that line and it immediately worked.
did u figure it out?