Codeforces Round 887 Div 2 | A B | Video Editorial C++

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

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

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

    Keep uploading videos, Loving them !

  • @nandanbhowmick1825
    @nandanbhowmick1825 4 หลายเดือนก่อน

    Great explanation of B. Thanks.

  • @Aman-wu4mb
    @Aman-wu4mb ปีที่แล้ว

    Nice explaination bhaiya.

  • @secondthread-uc9bd
    @secondthread-uc9bd ปีที่แล้ว

    Ty

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

    How do you build on so good logic that passes all the test cases , it happens always with me that basic given testcase passes but hidden always failed

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

      If the problem is greedy then always try proving your solution and trying out some random test cases before submitting your solution. It will always help.

  • @Mosigma-g1y
    @Mosigma-g1y ปีที่แล้ว

    thx for the good explanation :) go on

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

    For the 2nd problem, why should we fix last 3 to get a sequence? The last is fixed already as n. We only need to change the penultimate element to vary and generate different sequences. Or am I missing something here?

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

      You are right. To generate a new element you need two elements. So if you fix the last two you will be able to generate a sequence.
      This is just a small implementation difference.

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

      @@cpwithcpp 👍 thanks for the solid explanations

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

      @@aadhithyarp4879 th-cam.com/video/IdWDQCbKcic/w-d-xo.html easy solution

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

      ​@@cpwithcppb

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

    How you checked that sequence should contain exactly k terms?

    • @Mosigma-g1y
      @Mosigma-g1y ปีที่แล้ว +1

      its shown in the recursive function ... he assigned the parameter of position to (k - 2) and he make ans++ if pos = 1 only :)

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

      th-cam.com/video/Z9PvfQLfS4c/w-d-xo.html easy solution

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

    I found there was no meaning of writing min of 31ll just need to pass k - 2. We are writing min because k can be large but n only is allowing till 10 raise to 5 approx. Am i understanding it correctly?

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

      Yes if we take the first 31 numbers of any Fibonacci series it will already pass the value of N so no use of taking any greater value that is why we are taking min.

  • @secondthread-uc9bd
    @secondthread-uc9bd ปีที่แล้ว

    Suggestion: post what u learnt from upsolving missed problems from contests.

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

      I will try to update all the problems which I uplsolve after the contest in a youtube post.

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

      @@cpwithcpp Sir can you please explain us the approach of editorial of problem C if you upsolve it later Please make a video on it It would help us a lot , a lot of us are completely unable to understand the approach provided in editorial

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

      @@cpwithcpp yes posting your learnings from upsolving will be very helpful bcoz whatever concept you dont know surely we too dont know and we will also get to learn that. 🙌

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

    any good source to learn dfs i genrally gets confused during where to add visited and apply dfs operations

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

      Code N Code graph playlist is good you can watch from there. Many people also watch Striver's playlist so you can also check that out.

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

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

    Sir, How do we make observations like you did with 30 the problem was very easy if a person made this nice observation? The solution was screaming to my head but i though that it is O(n * k) so it wont work

    • @cpwithcpp
      @cpwithcpp  ปีที่แล้ว +3

      Whenever you think of brute force. Try to find the maximum upper bound on the problem. Try to estimate the correct complexities and feel free to use the internet during contests. It is allowed to use any resource which was published before the start of the contest.

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

      @@cpwithcpp Sir♥️

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

    i need 3rd

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

    I think the test cases of div 2 b was weak , and it was like if u only know then u can only solve it

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

      I saw some people got FST.

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

      ​@@cpwithcppfst ?🙄