41:50 just for info , changes[x+4*k]++ and changes[x+5*k]-- isnt neccessary needed . if the answer exists it would have been found in either [x,2k) or [2k,3k) or [3k,4k) .
Small Doubt : We are adding mp[ { x + dx , y + dx } ] in our answer and we are assuming dx with always increase by same amount, which might not be true. Consider: Width = 3 and s = "RR" , dx = 2 after one string execution then it becomes "RL" as we reach the right end of box, so dx after executing both strings is = #R - #L = 3 - 2 = 1 , But as per the logic you explained it will be 2 + 2 ( dx after executing one string two times ) = 4 which mismatches, please clarify🥲
If we look at the modified string, then we will be at X=0, when difference is 0, and X=W when difference is X, we will never have negative difference or > W difference. My claim was if we ignore changes and just look at original difference, then ....... are necessary and sufficient condifitions. Which is value mod 2W should be 0 for origin and W for X=W.
Hi bhai in the parity question. I Almost solved the question just 3rd and 4th test case is not passing there idk know why? First and second test case passed but third and 4th not passed I don't know why. I am adding two elements if they are even and odd. And if as per given conditions a(I)
paste the code here, either the logic would be wrong or you might not have taken into account the large numbers that are generally present in testcase 4,5,..... (instead of int, you have to declare long long int). if you paste the code here then maybe i will be able to help you. p.s. i am just a random coder came across your comment, here to seek help in upsolving unsolved problems from contest myself.
@@JayKhanderay-rk6gd this logic is incomplete, needs more thinking from your end, watch the editorial and learn the correct logic and then code yourself and then submit on codeforces👍👍
The way you reduce Problem D into DP was amazing
Thank you sir , following you from last month for upsolving and seeing my ability to think grow. 💝
this is like so great , explaining the doubts , keep doing it .
bhaiya..aapko hi follow krra hu cp me improve krne ke liye.. bas kabhi rukna mat,, you'll suerly succed in life i pray
Very minimal wm , love it
41:50 just for info , changes[x+4*k]++ and changes[x+5*k]-- isnt neccessary needed . if the answer exists it would have been found in either [x,2k) or [2k,3k) or [3k,4k) .
it can be only the first cycle if we make max= (max +k-1)
Small Doubt : We are adding mp[ { x + dx , y + dx } ] in our answer and we are assuming dx with always increase by same amount, which might not be true.
Consider: Width = 3 and s = "RR" , dx = 2 after one string execution then it becomes "RL" as we reach the right end of box, so dx after executing both strings is = #R - #L = 3 - 2 = 1 , But as per the logic you explained it will be 2 + 2 ( dx after executing one string two times ) = 4 which mismatches, please clarify🥲
If we look at the modified string, then we will be at X=0, when difference is 0, and X=W when difference is X, we will never have negative difference or > W difference.
My claim was if we ignore changes and just look at original difference, then ....... are necessary and sufficient condifitions.
Which is value mod 2W should be 0 for origin and W for X=W.
can anyone like explain me that how are we making sure that only ( n - 1 ) % k + 1 , elements are being picked ?
Keep up the good work!
Sir bohot cheating hoo rahi hai CF pe
Sir, how did you get idea for counting maximum number by dividing into row and coloumn
I didn't get why in the first place 0,1 array is needed?
Hi bhai in the parity question. I Almost solved the question just 3rd and 4th test case is not passing there idk know why? First and second test case passed but third and 4th not passed I don't know why. I am adding two elements if they are even and odd. And if as per given conditions a(I)
paste the code here, either the logic would be wrong or you might not have taken into account the large numbers that are generally present in testcase 4,5,..... (instead of int, you have to declare long long int). if you paste the code here then maybe i will be able to help you.
p.s. i am just a random coder came across your comment, here to seek help in upsolving unsolved problems from contest myself.
If (nums[I]%2! =nums[j]%2)
If(nums[I]
@@JayKhanderay-rk6gd this logic is incomplete, needs more thinking from your end, watch the editorial and learn the correct logic and then code yourself and then submit on codeforces👍👍
@@VivekRaj-vu9zn how? The logic is incomplete?
@@JayKhanderay-rk6gd watch the editorial and know the difference
Abe. Randomly feed people tu recommend ho gaya. Kaisa hai?
Bhai mai badiya hu. Tum batao kya haal chaal?
Worst explanation
why my answer is wrong please tell me
#include
using namespace std;
#include
#include
#include
#include
#include
#include
#include
#include
#include
long long solve(vector&temp){
priority_queue mini;
priority_queue maxi;
for(int i = 0; in;
for(int i = 0; i>a;
vector temp;
for(int j = 0; j>b;
temp.push_back(b);
}
for(int i = 0; i