Just started doing basic questions on Hacker Earth and got TLE after solution, tried everything I knew about fast I/O. Can anyone help me out?
My code:
Just started doing basic questions on Hacker Earth and got TLE after solution, tried everything I knew about fast I/O. Can anyone help me out?
My code:
Optimise your Code, not IO. You might want to use Prefix Sum.
You have to create a prefix sum array and then compute the mean of the numbers. As the constraints for the number of queries is 10^6.
And your code has a complexity of O(n^2). So this is not going to work.
Edit: I’ve tried to solve it check it here
I’ll do that, thankyou
Okayy, thankyou