Codeforces Round 838 Div 2 | Problem C : Binary Strings Are Fun Solution | Newton School

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ก.ย. 2024

ความคิดเห็น • 26

  • @_aka5h
    @_aka5h ปีที่แล้ว +21

    I refuse to believe that almost 4.5k people solved this problem.

  • @MonirHossain-gr2nv
    @MonirHossain-gr2nv ปีที่แล้ว +1

    Thanks a lot,,It was a new type of problem to me..

  • @ketanraghunathraut7615
    @ketanraghunathraut7615 ปีที่แล้ว +1

    instead of making dp_m, you can simply replace it by 1 as its value will always remain 1

  • @sahilanand30
    @sahilanand30 ปีที่แล้ว +1

    Nicely explained

  • @01utpalraj95
    @01utpalraj95 ปีที่แล้ว

    Thanks bhaiya for such videos

  • @SDE-wq4tl
    @SDE-wq4tl ปีที่แล้ว

    Nice explanation, I solved it in O(1) Space

    • @codingcommunitynewtonschoo8582
      @codingcommunitynewtonschoo8582  ปีที่แล้ว

      You might be using only 2 variables to store previous required values as we iterate in the loop instead of whole array, as only last value is required and keep on adding to the answer as we move forward...

  • @TrueSolutionsOfficial
    @TrueSolutionsOfficial ปีที่แล้ว

    nice video once again

  • @tapans2998
    @tapans2998 ปีที่แล้ว +1

    GOOD explanation karan! but i have doubt that dp_m array is not changing in pseudo code u wrote it is 1 throughtout

    • @praveensingh2060
      @praveensingh2060 ปีที่แล้ว

      The logic is correct though, so I think we can say that whenever an element is not equal to its previous element, there is only one unique extension that is good.

    • @tapans2998
      @tapans2998 ปีที่แล้ว +2

      @@praveensingh2060 yes and then we don't even require that dp_m array and simply we can use 1

    • @mohiuddinsami7627
      @mohiuddinsami7627 ปีที่แล้ว

      @@praveensingh2060In string "010" at index 3 when it gives us answer 1 shouldn't it be like ?
      0 _ 1 _ 0 we can fill the gaps like {1,0} , {0,1} , {0,0}
      and the resulting strings are 01100 , 00110 , 00100
      which all are valid. then shouldn't it be 3 as answer ?
      Can you explain where am i wrong : " )

  • @ADITYAKUMAR-tb4gm
    @ADITYAKUMAR-tb4gm ปีที่แล้ว +1

    Sir, can you please make a video on how to do interactive problems ??
    I was getting idleness limit exceeded every time. For c++ & java people

  • @Nikhilsainiharidwar
    @Nikhilsainiharidwar ปีที่แล้ว +2

    HOW TO Solve Dp problems on Codeforces ?

    • @subhambhakat3908
      @subhambhakat3908 ปีที่แล้ว +1

      Bro this question was simple logic.I even dont know dp but still solved it easily

  • @prianshubhatia2759
    @prianshubhatia2759 ปีที่แล้ว +1

    I got so close to this solution, but at the end chickened out thinking D level problem can't have a solution this straight forward 😂

  • @01utpalraj95
    @01utpalraj95 ปีที่แล้ว

    isme waise dp_m[i] toh hamesa 1 hi rhega sarre i ke liye ??

    • @shubhanshukumarsingh6133
      @shubhanshukumarsingh6133 ปีที่แล้ว +1

      exactly that's the point so why he is updating it, if it was same all time.

  • @siddhantagarwal4941
    @siddhantagarwal4941 ปีที่แล้ว +1

    Where is the code?

  • @shubhanshukumarsingh6133
    @shubhanshukumarsingh6133 ปีที่แล้ว

    pl give the code