I did the D using a multiset for finding the max charging time, and using an all over sliding window concept. This maybe a easier way to do it, this solution was accepted in the contest.
@@Harisamsharma man you post video on for. All contest, saw your Codeforces that's awesome, I just managed to. Solve 3 question should. I. Solve code forces or restrict myself to leetcode until I get better with 4 question
Your code for 4th question seems to be nlogn (O(1) in query max from sparse table hardware specific operation) I too tried Nlog^2(N) using multiset but it gave TLE then coded nlogn using (sliding window max)+binary search PS:ended up in 21 mins but one penalty so finish time 26 mins🥲
Hi, Can you please tell me how much math is needed to get good at cp and what are the maths topics one should cover before starting cp for beginners It would be helpful if you answer .thanks in advance!
Hi dude, I am able to think of solutions easily but I am pathetic at debugging and STL. I can think of the solutions but I feel too demotivated that I haven't learned it properly, any suggestions.
I did the D using a multiset for finding the max charging time, and using an all over sliding window concept. This maybe a easier way to do it, this solution was accepted in the contest.
And I sorted multiset in decresing order, i.e- multiset
hi nice sharing
It took 52 minutes for me... Did last question with sparce table+binary search
He also did it with sparse table + binary search but he named it dp
Nice overkill
But just a multiset would have worked
So. You are the guy who. Finishes contest in 5 mins
Lol no, that is someone named 'pathetic dog'
@@Harisamsharma man you post video on for. All contest, saw your Codeforces that's awesome, I just managed to. Solve 3 question should. I. Solve code forces or restrict myself to leetcode until I get better with 4 question
@@danishsharma496go for codeforces regardless of how good you are. you will improve much faster.
@@Harisamsharma I am also doing stiver dsa sheet should I complete that first
Your code for 4th question seems to be nlogn (O(1) in query max from sparse table hardware specific operation)
I too tried Nlog^2(N) using multiset but it gave TLE then coded nlogn using (sliding window max)+binary search
PS:ended up in 21 mins but one penalty so finish time 26 mins🥲
Wait so a segment tree for max and binary search gave TLE even in C++ ? I tried that approach but just thought that the TLE was because of Python.
@@grishound yeah Nlog^2N TLE in cpp also🥲
My code for 2nd question:
return false;
Yes, I did realize this after the contest XD
yeah
@@Harisamsharma what is the intuition behind that?
Ans :- return 0;
🤣🤣
Hi, Can you please tell me how much math is needed to get good at cp and what are the maths topics one should cover before starting cp for beginners It would be helpful if you answer .thanks in advance!
Only basic number theory(gcd, factors, etc) and basic combinatorics are needed.
we also maintain a multiset for maximum na ?
I did D with 2 pointers, but not sure why it works. Would you have an idea?
Are you referring to sliding window?
i used segment tree + two pointer.. segment tree to get maximum of a range
@@justjie1008 Yes
Hi dude, I am able to think of solutions easily but I am pathetic at debugging and STL. I can think of the solutions but I feel too demotivated that I haven't learned it properly, any suggestions.