congrats on 10K subscribers. Really hope your work get recognition what it deserves. I don't really see so many people streaming and discussing these problems in this very patient & calm way. I think your channel has become my primary source of explanation when I don't get the editorials(which most of the people don't, LOL).
love the subtle changes you are making to your setup shayan! and the solutions (esp. d) are elegant as always! looking forward to more series like 1500+ dp etc.
In B, instead of alternative -1 and 1, I kept the -1s together and then kept all other as 1, the no. of -1 and 1 after x and before y are the same in alternative and my approach but it was giving me wrong ans on pretest 2 at (5,2,1) : expected output: 1 1 -1 1 -1 my output: 1 1 -1 -1 1 on dry running , even my output satisfies the condition but still it gave me srong ans., can someone help me with this: #include using namespace std;
int main() { int t; cin >> t; while (t--){ float n,x,y; cin>>n>>x>>y;
vector a(n,1); float f=(n-x)/2; int fi=ceil(f); for(int i=0;i
I'd did the same thing before, I was able to figure why it fails but sadly after the contest. Consider this array below for n=10 , x=7, y=6 (this is what your code would return) 1 1 -1 -1 -1 1 1 -1 -1 1. (I separate them for easily spotting x and y) Now why does it fail. It fails specifically for x, because the question says x should be the smallest possible with the max value, but in the array above that is not the case. We have a prefix sum at index two which has a greater sum that the prefix sum at index x. Now the reason this passed test 1 was because we were having only consecutive segments of positive 1s with length less than x-y+1 (the length of y to x segment) once it becomes greeter or equal to that, it fails. But alternating it, just like Shayan said would guarantee we have no other sum than 0 and -1 for the prefix and suffix.
I was so close to B but didn't pass, cos' i know that before y and after x, it should be 1, -1, 1, -1, and close to x and y it should be -1. But I didn't code properly and got two contiguous -1 before y and after x... I also have a idea with C but also not pass.... shame on me
Can you cover F from the same comment? I got A-E easily but F gave me a lot of trouble. Figured out the case with no type 2 queries (array value update) by building a binary tree of local maxes, but updates ruin the structure. The tutorial is poorly written and writes wrong inequalities.
congrats on 10K subscribers. Really hope your work get recognition what it deserves. I don't really see so many people streaming and discussing these problems in this very patient & calm way. I think your channel has become my primary source of explanation when I don't get the editorials(which most of the people don't, LOL).
Thank you very much, man
love the subtle changes you are making to your setup shayan! and the solutions (esp. d) are elegant as always! looking forward to more series like 1500+ dp etc.
Glad you like it!
Sure, I will make more if you like those series.
Your passsion to cp and dedication to teach and helping other is incredible
Thank you bro
Congrats for 10.5K and thanks buddy for wonderful explanation.
Thanks a ton
You explain really well and with much patience. Love the streams ❤
Thank you for all the help.
@@mayankkharb4164 Such a comment really does boost my energy to keep improving the content.
I must thank you for your support ❤️
Congrats for 10k subs :)
Thank you ❤️
Man, you have a superpower for explaining things!
Haha! Thanks
this contest went horrible for me ,B just messed up my brain .
I hope the next one goes better.
Oh, I wish you a better one next time.
@@CPwithShayan Thank you so much
Great explanation shayan honestly you're the best out there
Congrats on 10k subs dude!
I have it because of your support. Thank you.
Your dp solution for d is really elegant..
I'm glad you liked it.
The explaination for problem 2 was very clear. Thanks a lot ❤❤❤❤
Glad to hear that
IN E question
If total nodes are 3000 and root node 1 has 2999 children can we able to solve it within 160 queries.
you helped me a lot, seriously, thank you very much
Glad I could help!
great explanations!! keep up the gr8 work
Thanks, will do!
keep up the good work
Sure thing
Thank you for the editorial
Sure thing
In B, instead of alternative -1 and 1, I kept the -1s together and then kept all other as 1, the no. of -1 and 1 after x and before y are the same in alternative and my approach but it was giving me wrong ans on pretest 2 at (5,2,1) :
expected output: 1 1 -1 1 -1
my output: 1 1 -1 -1 1
on dry running , even my output satisfies the condition but still it gave me srong ans., can someone help me with this:
#include
using namespace std;
int main()
{
int t;
cin >> t;
while (t--){
float n,x,y;
cin>>n>>x>>y;
vector a(n,1);
float f=(n-x)/2;
int fi=ceil(f);
for(int i=0;i
I'd did the same thing before, I was able to figure why it fails but sadly after the contest.
Consider this array below for n=10 , x=7, y=6 (this is what your code would return)
1 1 -1 -1 -1 1 1 -1 -1 1. (I separate them for easily spotting x and y)
Now why does it fail. It fails specifically for x, because the question says x should be the smallest possible with the max value, but in the array above that is not the case. We have a prefix sum at index two which has a greater sum that the prefix sum at index x.
Now the reason this passed test 1 was because we were having only consecutive segments of positive 1s with length less than x-y+1 (the length of y to x segment) once it becomes greeter or equal to that, it fails.
But alternating it, just like Shayan said would guarantee we have no other sum than 0 and -1 for the prefix and suffix.
@@daveshub oh yeah even I noticed that smallest possible x line in the question after re reading question so many times
just for the looks, it would be better if you keep the computer screen rectangle only or with lesser border radius
@@rashidaziz2215 Thanks for the feedback
Bro, you,'re the best
Thanks!
Thank you sir.
Very helpful!
Glad to hear that
Is this correct for D , Dp[i][1] minimum number of operation to color all cells white till i-1 th row including one 2x2 square which start at ith row
I think you're gonna need to take the second 2*2 into consideration as well.
excellent explanation
Thanks ❤️
You are the best
Thanks! Means a lot to me
great content sir
Thank you!
I was so close to B but didn't pass, cos' i know that before y and after x, it should be 1, -1, 1, -1, and close to x and y it should be -1. But I didn't code properly and got two contiguous -1 before y and after x... I also have a idea with C but also not pass.... shame on me
No problem, dude. You'll do better in the next round.
great video
Thanks!
The second was not that tough but I did'nt understand what the question was asking:(
Oh, I see.
Can you remove the background animation from now on? Its very distracting
I see. I’ll put a vote in the Telegram channel to see what to do. Thanks for mentioning
sir please continue dp 2000+ series
Sure, I’ll do if I know people get benefit from it.
Can you cover F from the same comment? I got A-E easily but F gave me a lot of trouble. Figured out the case with no type 2 queries (array value update) by building a binary tree of local maxes, but updates ruin the structure. The tutorial is poorly written and writes wrong inequalities.
Went very bad 😔. Couldn't even crack C
Not bad!