I am getting TLE in this problem. My code is at the link https://ide.codingblocks.com/s/238638. The constraints are t<=10 and n<=100000 and the time complexity is O(N log N). I could not understand why I am getting TLE.
Dividing array - Greedy problems
Is there someone available who can resolve my doubt???
@ankur8632 Yes your code seems to be fine.
Adding this in main
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
Might help, it increases the input output speed.
If this resolves your doubt mark it as resolved.
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.