I recently coded for CSBUQ, my code has complexity (N + Q) * log N.Now as per problem constaints max value for both N and Q is 5 * 10 ^ 5, for which total no of operations computes to around 2 * 10 ^ 7, I can’nt understand why my code occasionally gives TLE, (failing in worst case some times), and runs absolutely fine other times.
Any explanation why :
1.codechef engine is giving TLE even for 10 ^ 7 operations ( I think it can support 10 ^ 9 ops for time limit of 1 sec).
2.why the code gives TLE occasionally, and runs in time other times.
My code -> https://ideone.com/EwmVSH
My code is in java