i cant think of any test case which doesn't work. so can anyone find out the wrong test case?
@cp_with_vkd6 ай бұрын
In subsequence, order of characters should be maintained....at a glance I think this is the error in the code.. .....as you are using frequency array so there might be error in ordering I'll try to find the test case tommorow...
@Sai-ir8yh6 ай бұрын
@@cp_with_vkd Thank you, it would be very helpful. Actually all testcases i can think of, pass
@kohinoor96476 ай бұрын
@@Sai-ir8yh a=cabcefg b=bcaefg answer should be 8 ur code will give wrong answer :)
@cp_with_vkd6 ай бұрын
My Submission Link : codeforces.com/contest/1989/submission/267765133
@shristisrivastava70546 ай бұрын
Very nice explanation. Looking forward to more videos.
@khushchoudhary98326 ай бұрын
how to do this using segment tree
@vaibhavjaiswal80347 ай бұрын
Great Explanation
@Iammuslim9477 ай бұрын
I watched many vids everybody was explaining the logic but nobody was explaining the code part like why we r using map and adding freq n all but u explained clearly.well done.👍🏻
@anukulchauhan36367 ай бұрын
Very well explained and within a perfect time frame.
@GYANKIBAAT-ze7nd7 ай бұрын
Why can't we sort the array and return 2nd last element as it must be biggest among all the median
@cp_with_vkd7 ай бұрын
Consider the case : 5 2 1 3 6 In this case ans can never be 5 Because no matter which range you choose 5 can never become median Hence its always not correct to return 2nd largest element We have to check whether it can become median or not
@abhishekrai37 ай бұрын
hello sir, apke samjhane ka tarika really bahot achcha hai. Rarely mujhe koi aisi video mili hogi jisme itne detail ke sath kisine explain kiya ho. Thanks alot sir for amzing explanation.
@cper-pi2sz7 ай бұрын
Thanks for explaining everything in detail
@cper-pi2sz7 ай бұрын
Thanks for the explanation. It is really helpful
@DeepakKumar-mn8yi7 ай бұрын
4 question bhi explain kar do bhaiya
@cp_with_vkd7 ай бұрын
Done !! Video uploaded
@DeepakKumar-mn8yi7 ай бұрын
sexy explanation
@cper-pi2sz7 ай бұрын
Good explanation Please make video on D also
@ShreyaSingh-fz6ho7 ай бұрын
Thanks for the clear explanation
@ShreyaSingh-fz6ho7 ай бұрын
Nice explanation
@ShreyaSingh-fz6ho7 ай бұрын
Good explanation keep making videos it helps us a lot to learn
@cper-pi2sz7 ай бұрын
Helpful !! Keep making videos after each contest❤
@vimalkumardubey68347 ай бұрын
Small correction at 16:08 ...we have to take next rounded value...5/2 = 3
@PremSagarKPS7 ай бұрын
Problem A's solution is wrong In the solution you said, if there are <= 2 segments of sorted array then answer will be YES But, just check the given test cases in the question itself, if array = 1 1 4 5 1 4 answer = No Please explain
@cp_with_vkd7 ай бұрын
Thanks for mentioning...ans will not always exist...but as I have said you have to check for both the cases x y and y x If any one of them is sorted Then yes
@cp_with_vkd7 ай бұрын
You can refer to The code from description
@vikaskumaryadav53117 ай бұрын
Thanks Bro
@ksieiehxnzna7 ай бұрын
why is window 3? Why not 2, so that it would be min of consecutive elements?
@cp_with_vkd7 ай бұрын
Yes that will also be correct....but you have to take adjacent as well as...min(a[i] , a[i+2]) Test case : 4 2 4 2 4 2 4 In this if You will consider only 2 elements then ans will be 2 But ans is 4
@ksieiehxnzna7 ай бұрын
Oh okay, makes sense
@ksieiehxnzna7 ай бұрын
@@cp_with_vkd btw, is that the onlu test case that fails on? alternating with small and bigger?
@cp_with_vkd7 ай бұрын
Not necessarily alternating.. This can also be the case 2 4 2 6 1 7 in this ans will be 2 if you consider 2 consecutive...but correct answer is 6
@ksieiehxnzna7 ай бұрын
@@cp_with_vkd oh okay, i am now clear on why 2 does not work, but still trouble understanding why 3 will work, why not 4, why not 5.
@wakabaP-d7y7 ай бұрын
thanks!
@formidablechief277 ай бұрын
great work !!
@ItachiUchiha-ou8mq7 ай бұрын
y > 2 pr kse work krega ??
@cp_with_vkd7 ай бұрын
2 se bade ke liye bhi karega kaam We are taking one grid at a time and placing maximum number of possible in that grid .... One grid can contain at most 2 boxes of 2x2 and remaining will be covered with 1x1
@cp_with_vkd7 ай бұрын
You can refer to my Solution : codeforces.com/contest/1974/submission/261812681
@cp_with_vkd7 ай бұрын
Problem C video solution (cat, fox and double maximum) : kzbin.info/www/bejne/jHTUdot4q92Liqcsi=9obFRxs5jW8LnrNk
@bishwashkumarsah1717 ай бұрын
other youtubers were just using the one liner but i couldnot understand that. ans = min(p1+p2,(p1+p2+p3)//2). can you explain this solution too that is in the editorial. Nice sol
@cp_with_vkd7 ай бұрын
If you want the explanation for the O(1) solution, it goes like this: As, we are always increasing p1+p2+p3 by 2 (1,1 in case of draw and 2,0 in case of win), the invariant is pretty clear, i.e.., (p1+p2+p3)%2=0 for a valid game. Now, we have p1≤p2≤p3, so we can always have atleast p1 draws. Thus, from p2 and p3, we have to remove p1 points, leaving us with p2+p3−p1 points. Obviously, in the most optimal case, we could have (p2+p3−p1)/2 more draws (if we had equal points left for both), but this is not necessarily the case as it is possible that p2<(p2+p3−p1)/2, in such a case, we can add p2 to the score. So my final O(1) solution looks like: 1) If (p1+p2+p3)%2≠0⟹ No solution possible. 2) Otherwise, the answer can be found out using the expression p1+min(p2,(p2+p3−p1)/2). Hope this helps!
@dipteshraj91697 ай бұрын
@@cp_with_vkd Absolutely awesome , Now I got it... couldn't understood this o(1) approach by watchinng other yt videos on internet