how to declare an array of huge no of elements??
For Example:
In This QUESTION for subtask 2 MY SOLUTION it shows WA, I think it is because of size of the array???
PLEASE help me out…Thanks in Advance
how to declare an array of huge no of elements??
For Example:
In This QUESTION for subtask 2 MY SOLUTION it shows WA, I think it is because of size of the array???
PLEASE help me out…Thanks in Advance
@root00198 It shows WA because of TLE (Time Limit Exceeded) and not because of size of the array. To know more about TLE refer
here. The most common reason that you would get a TLE is because your program is too slow.
Refer here to see why and what gives a TLE-
The reason is that, a computer can perform atmost {10}^{8}-{10}^{9} instructions per second. In case the size of array is about {10}^{5}, then your O({N}^{2}) algorithm takes atleast {10}^{10} instructions per test case, which needs more than 10 seconds or even more than a minute.
Further, I see you used vectors, I think it must be clear to you that vectors are further slower than arrays.
thanks :);
thanks :);