Help with error

sol: https://ide.codingblocks.com/s/418428

prob: https://hack.codingblocks.com/app/contests/2022/727/problem

getting tle please tell the mistake

look at constraints
Constraints

1 <= N <= 10^7
-109 <= A[i] <= 109

size of array is 10^7
but your array size has 10^3 only

Modified Code

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.