I am CM at CF, 6* at CC and Blue at Atcoder. I will try to explain some CP/Leetcode problems which are interesting to me and no other better explanations of those problems are available till my video.
You explain well, I recomand you to give us all approach from brute force to optimal, If you do it your chanal will grow because no one do this.
@soumyabhattacharjee10514 сағат бұрын
Sure, will keep that in mind
@prajjawalsingh49523 күн бұрын
nice explanation 👍
@ouvik95093 күн бұрын
very helpful dada ❤
@kashishchawla27543 күн бұрын
d problem?
@soumyabhattacharjee10513 күн бұрын
D is kind of a simple breadth-first search, so have not covered it, you can check my solution atcoder.jp/contests/abc361/submissions/55280719 and ask me if there is any doubt
@kashishchawla27543 күн бұрын
@@soumyabhattacharjee1051 understood the approach, how can we be sure about the tc, can u pls elborate
@soumyabhattacharjee10513 күн бұрын
@@kashishchawla2754 The total number of states are at max O(N2^N) N for choosing the i where i and i+1 are spaces and 2^N for combinations of other. Now for each space the rearrangement is O(N) so overall complexity should not be more than O(N^2*2^N) Please like and subscribe if it is helpful
@kashishchawla27543 күн бұрын
thanks
@PubgMerabeta3 күн бұрын
Bro can you explain C and D prb too?
@soumyabhattacharjee10513 күн бұрын
D is kind of a simple breadth-first search, so have not covered it, you can check my solution atcoder.jp/contests/abc361/submissions/55280719 and ask me if there is any doubt For C you can think about having a subsequence of N-K elements, so we can sort it and consider every subarray of size n-k. Here is my solution atcoder.jp/contests/abc361/submissions/55269760
@Jafar8014 күн бұрын
Your explanations are way better than @aryanc's. Thank you for making such good explanatory videos. Keep it up!
@darkknight98-v4 күн бұрын
thanks for such a simple and great explanation sir!
@furynick16206 күн бұрын
Thank you sir. I learnt a lot from you.
@avijitbiswas35448 күн бұрын
dp[i][1] = ( 1 + (n - 1) * (n - 1) ) * dp[i - 1] [1] can you explain why you are adding + 1 there. that part is already cover na?
@soumyabhattacharjee10518 күн бұрын
No (n-1)(n-1) is for choosing anything other than the current j, and 1 when getting (j,j) Please like, share and subscribe if it's helpful
@avijitbiswas35448 күн бұрын
@@soumyabhattacharjee1051 subscribed sir
@angryman55179 күн бұрын
Bro,can you help with B? I am trying to code it in python
@soumyabhattacharjee10519 күн бұрын
Try to contruct the string for every value of c and w Here is my python code for ref: atcoder.jp/contests/abc360/submissions/55056440 Please like and subscribe if it is hepful
@ITACHIUCHIHA-dr8sz9 күн бұрын
underrated channel, love these crisp explanations over those 40 to 60 minute long other video solutions
@soumyabhattacharjee10519 күн бұрын
Thank you so much for the appreciation, it means a lot. Hope you subscribed 😀
@amolmittal88959 күн бұрын
great solution😊
@kz_cbble96709 күн бұрын
why did u stop codeforces?
@soumyabhattacharjee10519 күн бұрын
Generally cf contests are on weekdays and I do not get time to attend those. If there is some on weekend I can check those. As I am not regular and codeforces contests need grinding, I avoid participating rated. If there is something unrated like div3 in weekends I will definitely try to do it
@kz_cbble96709 күн бұрын
@@soumyabhattacharjee1051 Understandable.. bro has a job to keep
@blazerchicken161910 күн бұрын
Thank you, finally understood what the problem was trying to say
@soumyabhattacharjee105110 күн бұрын
Thanks for the appreciation, please subscribe if you have not already 😃
@Dhruv-fn8yr15 күн бұрын
provide solution for probem G
@shubhamtanwar703915 күн бұрын
great explaination
@shivamshrivastava563616 күн бұрын
Sir in case one of the values contains an odd number of elements, we have to ignore one of the elements. My intuition was to two create two cases: In the first case we will ignore the smallest element of the set and in the second case we will ignore the largest element of the set, we will take the minimum of the two cases in our answer. However, my approach is failing on some of the test cases.
@soumyabhattacharjee105115 күн бұрын
Consider the case 1 3 9 15 17 Here we have to ignore 9 which is neither max or min Please subscribe if you find this helpful
@FactsPolice16 күн бұрын
Bro 23311's output is 19
@soumyabhattacharjee105116 күн бұрын
Sorry, did not get it. Can you elaborate?
@FactsPolice16 күн бұрын
@@soumyabhattacharjee1051 look at the first test case's 7th number input and output
@manmeet70416 күн бұрын
Could u recommend some dp on bits questions
@thequacker650416 күн бұрын
this contest was more difficult than past contests
@soumyabhattacharjee105116 күн бұрын
Yes this C broke the flow of the contest, maybe easier C would be better
@The-fc1fi16 күн бұрын
Biweekly 4th question
@amimultamim989316 күн бұрын
Thanks a lot!
@soumyabhattacharjee105116 күн бұрын
Please subscribe if you find this helpful!!
@sudhanshunain469022 күн бұрын
thank u!! I thought the same idea but wasnt able to implement it. Can you also discuss 2 more approaches given in editorial, 1) By SCC and topological sort 2) Something related to depth of directed tree etc.
@code411122 күн бұрын
Great explanation ❤️❤️
@Anonymous____________A72123 күн бұрын
Can we do rerooting instead of "in-out dp"
@helpingcoder191024 күн бұрын
👍
@kashishchawla275424 күн бұрын
g problem pls, thanks:)
@soumyabhattacharjee105124 күн бұрын
Its already there in the channel, please check. Thanks. Please subscribe
@darksidekiller530024 күн бұрын
amazing screencast Can you please explain the last question in detail? Thank you
@mayankshakya920024 күн бұрын
Bhaiya is there any way to connect with you?
@mayankshakya920024 күн бұрын
Except linkedin
@mayankshakya920024 күн бұрын
I wanna ask about cp
@soumyabhattacharjee105124 күн бұрын
Hey, lets connect on linkedin
@solvinglife665825 күн бұрын
Cfbr
@Anonymous____________A72127 күн бұрын
Excellent subscribed But can we do this with heap/sliding window
@thequacker650428 күн бұрын
the code you have provided has used (n*s) while calculating the power which will overflow in cpp but gets accepted in python but in cpp to do binary exponentiation of (10,n*s) we will have to use euler totient function of mod
@soumyabhattacharjee105128 күн бұрын
Not necessarily, 2 tricks you can use for the given constraints. Unsigned long long instead of long long to store r=10^s, and then you can use (r^n-1)/(r-1). You can check my code atcoder.jp/contests/abc357/submissions/54462244. Please like and subscribe if it is helpful
@thequacker650428 күн бұрын
@@soumyabhattacharjee1051 got it thanks! Subscribed!
@helpingcoder1910Ай бұрын
there is one more condition. that when you do (a/b) % m. b should not be integral multiple of m. How do you prove that here (10 ^ k - 1) is not multiple of mod= 998244353 ??
@soumyabhattacharjee1051Ай бұрын
You can check out the article link I have provided in the description for further details, generally if the modulo is prime I use this formula but have not checked the proof yet. Please like and subscribe if you find this helpful
@helpingcoder1910Ай бұрын
👍
@terrytao7640Ай бұрын
solved it by myself..thanks
@ayush2060Ай бұрын
not understandable at all
@palakaggarwal5327Ай бұрын
Amazing approach! Thanks for sharing. How did u come up with this one?
@soumyabhattacharjee1051Ай бұрын
You can check my screencast for this contest kzread.info/dash/bejne/X4eT0JSmftPdobg.html (Please use earphones)
@AMITSHARMA-zt4eeАй бұрын
bro mic thik kr lo apna awaz hi nhi aa rhi hai , itna dhree bol rhe ho
@soumyabhattacharjee1051Ай бұрын
Yes some issue with the voice today, please use earphones for now. Will improve it surely
@jayantsharma3968Ай бұрын
Great explanation!
@akashtomar6115Ай бұрын
Thanks
@darkknight98-vАй бұрын
Sir can you explain the transitions again? i mean why you used AND if turn==0 and OR otherwise
@soumyabhattacharjee1051Ай бұрын
ans means who is winning. Its initialized to the opposite of the current player. So let say if its 0's turn then ans=1. Now if any one of the possible (i,j) leads us to the 0 then the current player will win. So we are taking bitwise and. Because only one 0 will make the answer 0. Similar for 1, we are taking OR because only one 1 will make the ans 1. If you find this helpful please like, share and subscribe, thanks
@darkknight98-vАй бұрын
@@soumyabhattacharjee1051 oh got it! thanks a lot again! also sir, can you refer some problems of bitmask dp(cf or atcoder) to practice because I just got introduced to it through this video.
@user-up3ne1sq6tАй бұрын
why we are using & in 67th line and | in 68th line this portion is not clear
@soumyabhattacharjee1051Ай бұрын
ans means who is winning. Its initialized to the opposite of the current player. So let say if its 0's turn then ans=1. Now if any one of the possible (i,j) leads us to the 0 then the current player will win. So we are taking bitwise and. Because only one 0 will make the answer 0. Similar for 1, we are taking OR because only one 1 will make the ans 1. If you find this helpful please like, share and subscribe, thanks
@user-mi4fd5qt2uАй бұрын
Good One Bro !!
@johnypappa1Ай бұрын
Subtracting values in the update -- last part of the video. Can you please explain only that part. Thanks
@jayantsharma3968Ай бұрын
Thanks a lot! 🙏🏻
@rassulkhassen6603Ай бұрын
👍👍
@jayantsharma3968Ай бұрын
Could you also please explain problem F
@kashishchawla2754Ай бұрын
@Soumya Bhattacharjee
@soumyabhattacharjee1051Ай бұрын
@@kashishchawla2754 @jayantsharma3968 I have not tried F, have to check out
@jayantsharma3968Ай бұрын
Great explanation, thanks very much!
@subhodeepmaji59972 ай бұрын
Felt like you tried to explain someone else's code and idea without even understanding. Waste of time!
Пікірлер
You explain well, I recomand you to give us all approach from brute force to optimal, If you do it your chanal will grow because no one do this.
Sure, will keep that in mind
nice explanation 👍
very helpful dada ❤
d problem?
D is kind of a simple breadth-first search, so have not covered it, you can check my solution atcoder.jp/contests/abc361/submissions/55280719 and ask me if there is any doubt
@@soumyabhattacharjee1051 understood the approach, how can we be sure about the tc, can u pls elborate
@@kashishchawla2754 The total number of states are at max O(N2^N) N for choosing the i where i and i+1 are spaces and 2^N for combinations of other. Now for each space the rearrangement is O(N) so overall complexity should not be more than O(N^2*2^N) Please like and subscribe if it is helpful
thanks
Bro can you explain C and D prb too?
D is kind of a simple breadth-first search, so have not covered it, you can check my solution atcoder.jp/contests/abc361/submissions/55280719 and ask me if there is any doubt For C you can think about having a subsequence of N-K elements, so we can sort it and consider every subarray of size n-k. Here is my solution atcoder.jp/contests/abc361/submissions/55269760
Your explanations are way better than @aryanc's. Thank you for making such good explanatory videos. Keep it up!
thanks for such a simple and great explanation sir!
Thank you sir. I learnt a lot from you.
dp[i][1] = ( 1 + (n - 1) * (n - 1) ) * dp[i - 1] [1] can you explain why you are adding + 1 there. that part is already cover na?
No (n-1)(n-1) is for choosing anything other than the current j, and 1 when getting (j,j) Please like, share and subscribe if it's helpful
@@soumyabhattacharjee1051 subscribed sir
Bro,can you help with B? I am trying to code it in python
Try to contruct the string for every value of c and w Here is my python code for ref: atcoder.jp/contests/abc360/submissions/55056440 Please like and subscribe if it is hepful
underrated channel, love these crisp explanations over those 40 to 60 minute long other video solutions
Thank you so much for the appreciation, it means a lot. Hope you subscribed 😀
great solution😊
why did u stop codeforces?
Generally cf contests are on weekdays and I do not get time to attend those. If there is some on weekend I can check those. As I am not regular and codeforces contests need grinding, I avoid participating rated. If there is something unrated like div3 in weekends I will definitely try to do it
@@soumyabhattacharjee1051 Understandable.. bro has a job to keep
Thank you, finally understood what the problem was trying to say
Thanks for the appreciation, please subscribe if you have not already 😃
provide solution for probem G
great explaination
Sir in case one of the values contains an odd number of elements, we have to ignore one of the elements. My intuition was to two create two cases: In the first case we will ignore the smallest element of the set and in the second case we will ignore the largest element of the set, we will take the minimum of the two cases in our answer. However, my approach is failing on some of the test cases.
Consider the case 1 3 9 15 17 Here we have to ignore 9 which is neither max or min Please subscribe if you find this helpful
Bro 23311's output is 19
Sorry, did not get it. Can you elaborate?
@@soumyabhattacharjee1051 look at the first test case's 7th number input and output
Could u recommend some dp on bits questions
this contest was more difficult than past contests
Yes this C broke the flow of the contest, maybe easier C would be better
Biweekly 4th question
Thanks a lot!
Please subscribe if you find this helpful!!
thank u!! I thought the same idea but wasnt able to implement it. Can you also discuss 2 more approaches given in editorial, 1) By SCC and topological sort 2) Something related to depth of directed tree etc.
Great explanation ❤️❤️
Can we do rerooting instead of "in-out dp"
👍
g problem pls, thanks:)
Its already there in the channel, please check. Thanks. Please subscribe
amazing screencast Can you please explain the last question in detail? Thank you
Bhaiya is there any way to connect with you?
Except linkedin
I wanna ask about cp
Hey, lets connect on linkedin
Cfbr
Excellent subscribed But can we do this with heap/sliding window
the code you have provided has used (n*s) while calculating the power which will overflow in cpp but gets accepted in python but in cpp to do binary exponentiation of (10,n*s) we will have to use euler totient function of mod
Not necessarily, 2 tricks you can use for the given constraints. Unsigned long long instead of long long to store r=10^s, and then you can use (r^n-1)/(r-1). You can check my code atcoder.jp/contests/abc357/submissions/54462244. Please like and subscribe if it is helpful
@@soumyabhattacharjee1051 got it thanks! Subscribed!
there is one more condition. that when you do (a/b) % m. b should not be integral multiple of m. How do you prove that here (10 ^ k - 1) is not multiple of mod= 998244353 ??
You can check out the article link I have provided in the description for further details, generally if the modulo is prime I use this formula but have not checked the proof yet. Please like and subscribe if you find this helpful
👍
solved it by myself..thanks
not understandable at all
Amazing approach! Thanks for sharing. How did u come up with this one?
You can check my screencast for this contest kzread.info/dash/bejne/X4eT0JSmftPdobg.html (Please use earphones)
bro mic thik kr lo apna awaz hi nhi aa rhi hai , itna dhree bol rhe ho
Yes some issue with the voice today, please use earphones for now. Will improve it surely
Great explanation!
Thanks
Sir can you explain the transitions again? i mean why you used AND if turn==0 and OR otherwise
ans means who is winning. Its initialized to the opposite of the current player. So let say if its 0's turn then ans=1. Now if any one of the possible (i,j) leads us to the 0 then the current player will win. So we are taking bitwise and. Because only one 0 will make the answer 0. Similar for 1, we are taking OR because only one 1 will make the ans 1. If you find this helpful please like, share and subscribe, thanks
@@soumyabhattacharjee1051 oh got it! thanks a lot again! also sir, can you refer some problems of bitmask dp(cf or atcoder) to practice because I just got introduced to it through this video.
why we are using & in 67th line and | in 68th line this portion is not clear
ans means who is winning. Its initialized to the opposite of the current player. So let say if its 0's turn then ans=1. Now if any one of the possible (i,j) leads us to the 0 then the current player will win. So we are taking bitwise and. Because only one 0 will make the answer 0. Similar for 1, we are taking OR because only one 1 will make the ans 1. If you find this helpful please like, share and subscribe, thanks
Good One Bro !!
Subtracting values in the update -- last part of the video. Can you please explain only that part. Thanks
Thanks a lot! 🙏🏻
👍👍
Could you also please explain problem F
@Soumya Bhattacharjee
@@kashishchawla2754 @jayantsharma3968 I have not tried F, have to check out
Great explanation, thanks very much!
Felt like you tried to explain someone else's code and idea without even understanding. Waste of time!