Hitesh bhai one thing , even i got that it is binary search in contest but was thinking that how 10^5*10^5 could get passed in 1 sec , because i had read somewhere that 2*10^8 operation per sec is rule of thumb but now a days even 10^9 can get passed in 1 sec but here it is 10^10 so how this sol not getting tle, correct me pls.
@HiteshTripathi2 жыл бұрын
For clarification about this , you should always see last line of input section, there it is written that sum of n over all test cases will not exceed 2.10^5 , so basically testcases are designed like this that they dont exceed given limit
@schrodingerscat61892 жыл бұрын
Another thing this is that Using binary search is NlogN and not N^2 so it wont reach 10^10 but only till 10^6.... Ofcourse you should consider that summation of all N over all tests is
@aniketkankekar4102 жыл бұрын
Nice Explanation
@abhizanzarukia76132 жыл бұрын
Hitesh how can we predict that the problem can be solved with binary search? i mean finding max of a min or vice versa does that thing give intuition of using binary search? can you please explain how one can come up with binary search as correct algo for this que?
@HiteshTripathi2 жыл бұрын
Yes i just checked that we hv a range and we hv to find maximum or min , can we apply binary search , it is like this
@shreyashagrawal54062 жыл бұрын
Hi, do you have any suggestions on how one should upsolve the problems, which we couldn't solve during contests?
@HiteshTripathi2 жыл бұрын
Just starting solving from past contest in which you haven’t participated…… nd if you hv time to give virtual contest so try to give virtual of all those contests ……