Soumya Bhattacharjee

Soumya Bhattacharjee

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.

Пікірлер

  • @adi4178
    @adi41785 сағат бұрын

    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.

  • @soumyabhattacharjee1051
    @soumyabhattacharjee10514 сағат бұрын

    Sure, will keep that in mind

  • @prajjawalsingh4952
    @prajjawalsingh49523 күн бұрын

    nice explanation 👍

  • @ouvik9509
    @ouvik95093 күн бұрын

    very helpful dada ❤

  • @kashishchawla2754
    @kashishchawla27543 күн бұрын

    d problem?

  • @soumyabhattacharjee1051
    @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

  • @kashishchawla2754
    @kashishchawla27543 күн бұрын

    @@soumyabhattacharjee1051 understood the approach, how can we be sure about the tc, can u pls elborate

  • @soumyabhattacharjee1051
    @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

  • @kashishchawla2754
    @kashishchawla27543 күн бұрын

    thanks

  • @PubgMerabeta
    @PubgMerabeta3 күн бұрын

    Bro can you explain C and D prb too?

  • @soumyabhattacharjee1051
    @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

  • @Jafar801
    @Jafar8014 күн бұрын

    Your explanations are way better than @aryanc's. Thank you for making such good explanatory videos. Keep it up!

  • @darkknight98-v
    @darkknight98-v4 күн бұрын

    thanks for such a simple and great explanation sir!

  • @furynick1620
    @furynick16206 күн бұрын

    Thank you sir. I learnt a lot from you.

  • @avijitbiswas3544
    @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?

  • @soumyabhattacharjee1051
    @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

  • @avijitbiswas3544
    @avijitbiswas35448 күн бұрын

    @@soumyabhattacharjee1051 subscribed sir

  • @angryman5517
    @angryman55179 күн бұрын

    Bro,can you help with B? I am trying to code it in python

  • @soumyabhattacharjee1051
    @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-dr8sz
    @ITACHIUCHIHA-dr8sz9 күн бұрын

    underrated channel, love these crisp explanations over those 40 to 60 minute long other video solutions

  • @soumyabhattacharjee1051
    @soumyabhattacharjee10519 күн бұрын

    Thank you so much for the appreciation, it means a lot. Hope you subscribed 😀

  • @amolmittal8895
    @amolmittal88959 күн бұрын

    great solution😊

  • @kz_cbble9670
    @kz_cbble96709 күн бұрын

    why did u stop codeforces?

  • @soumyabhattacharjee1051
    @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_cbble9670
    @kz_cbble96709 күн бұрын

    @@soumyabhattacharjee1051 Understandable.. bro has a job to keep

  • @blazerchicken1619
    @blazerchicken161910 күн бұрын

    Thank you, finally understood what the problem was trying to say

  • @soumyabhattacharjee1051
    @soumyabhattacharjee105110 күн бұрын

    Thanks for the appreciation, please subscribe if you have not already 😃

  • @Dhruv-fn8yr
    @Dhruv-fn8yr15 күн бұрын

    provide solution for probem G

  • @shubhamtanwar7039
    @shubhamtanwar703915 күн бұрын

    great explaination

  • @shivamshrivastava5636
    @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.

  • @soumyabhattacharjee1051
    @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

  • @FactsPolice
    @FactsPolice16 күн бұрын

    Bro 23311's output is 19

  • @soumyabhattacharjee1051
    @soumyabhattacharjee105116 күн бұрын

    Sorry, did not get it. Can you elaborate?

  • @FactsPolice
    @FactsPolice16 күн бұрын

    @@soumyabhattacharjee1051 look at the first test case's 7th number input and output

  • @manmeet704
    @manmeet70416 күн бұрын

    Could u recommend some dp on bits questions

  • @thequacker6504
    @thequacker650416 күн бұрын

    this contest was more difficult than past contests

  • @soumyabhattacharjee1051
    @soumyabhattacharjee105116 күн бұрын

    Yes this C broke the flow of the contest, maybe easier C would be better

  • @The-fc1fi
    @The-fc1fi16 күн бұрын

    Biweekly 4th question

  • @amimultamim9893
    @amimultamim989316 күн бұрын

    Thanks a lot!

  • @soumyabhattacharjee1051
    @soumyabhattacharjee105116 күн бұрын

    Please subscribe if you find this helpful!!

  • @sudhanshunain4690
    @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.

  • @code4111
    @code411122 күн бұрын

    Great explanation ❤️❤️

  • @Anonymous____________A721
    @Anonymous____________A72123 күн бұрын

    Can we do rerooting instead of "in-out dp"

  • @helpingcoder1910
    @helpingcoder191024 күн бұрын

    👍

  • @kashishchawla2754
    @kashishchawla275424 күн бұрын

    g problem pls, thanks:)

  • @soumyabhattacharjee1051
    @soumyabhattacharjee105124 күн бұрын

    Its already there in the channel, please check. Thanks. Please subscribe

  • @darksidekiller5300
    @darksidekiller530024 күн бұрын

    amazing screencast Can you please explain the last question in detail? Thank you

  • @mayankshakya9200
    @mayankshakya920024 күн бұрын

    Bhaiya is there any way to connect with you?

  • @mayankshakya9200
    @mayankshakya920024 күн бұрын

    Except linkedin

  • @mayankshakya9200
    @mayankshakya920024 күн бұрын

    I wanna ask about cp

  • @soumyabhattacharjee1051
    @soumyabhattacharjee105124 күн бұрын

    Hey, lets connect on linkedin

  • @solvinglife6658
    @solvinglife665825 күн бұрын

    Cfbr

  • @Anonymous____________A721
    @Anonymous____________A72127 күн бұрын

    Excellent subscribed But can we do this with heap/sliding window

  • @thequacker6504
    @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

  • @soumyabhattacharjee1051
    @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

  • @thequacker6504
    @thequacker650428 күн бұрын

    @@soumyabhattacharjee1051 got it thanks! Subscribed!

  • @helpingcoder1910
    @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
    @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
    @helpingcoder1910Ай бұрын

    👍

  • @terrytao7640
    @terrytao7640Ай бұрын

    solved it by myself..thanks

  • @ayush2060
    @ayush2060Ай бұрын

    not understandable at all

  • @palakaggarwal5327
    @palakaggarwal5327Ай бұрын

    Amazing approach! Thanks for sharing. How did u come up with this one?

  • @soumyabhattacharjee1051
    @soumyabhattacharjee1051Ай бұрын

    You can check my screencast for this contest kzread.info/dash/bejne/X4eT0JSmftPdobg.html (Please use earphones)

  • @AMITSHARMA-zt4ee
    @AMITSHARMA-zt4eeАй бұрын

    bro mic thik kr lo apna awaz hi nhi aa rhi hai , itna dhree bol rhe ho

  • @soumyabhattacharjee1051
    @soumyabhattacharjee1051Ай бұрын

    Yes some issue with the voice today, please use earphones for now. Will improve it surely

  • @jayantsharma3968
    @jayantsharma3968Ай бұрын

    Great explanation!

  • @akashtomar6115
    @akashtomar6115Ай бұрын

    Thanks

  • @darkknight98-v
    @darkknight98-vАй бұрын

    Sir can you explain the transitions again? i mean why you used AND if turn==0 and OR otherwise

  • @soumyabhattacharjee1051
    @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
    @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
    @user-up3ne1sq6tАй бұрын

    why we are using & in 67th line and | in 68th line this portion is not clear

  • @soumyabhattacharjee1051
    @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
    @user-mi4fd5qt2uАй бұрын

    Good One Bro !!

  • @johnypappa1
    @johnypappa1Ай бұрын

    Subtracting values in the update -- last part of the video. Can you please explain only that part. Thanks

  • @jayantsharma3968
    @jayantsharma3968Ай бұрын

    Thanks a lot! 🙏🏻

  • @rassulkhassen6603
    @rassulkhassen6603Ай бұрын

    👍👍

  • @jayantsharma3968
    @jayantsharma3968Ай бұрын

    Could you also please explain problem F

  • @kashishchawla2754
    @kashishchawla2754Ай бұрын

    @Soumya Bhattacharjee

  • @soumyabhattacharjee1051
    @soumyabhattacharjee1051Ай бұрын

    @@kashishchawla2754 @jayantsharma3968 I have not tried F, have to check out

  • @jayantsharma3968
    @jayantsharma3968Ай бұрын

    Great explanation, thanks very much!

  • @subhodeepmaji5997
    @subhodeepmaji59972 ай бұрын

    Felt like you tried to explain someone else's code and idea without even understanding. Waste of time!