2000+ DP #5 | 777E - Hanoi Factory | Solving Dynamic Programming Codeforces Problems

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

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

  • @mohitejaikumar
    @mohitejaikumar วันที่ผ่านมา

    Thanks for doing this , please extend this list

  • @hkrai1372
    @hkrai1372 2 หลายเดือนก่อน

    why it will not give tle . at 19:19 the while of stack can give tle . assume u are at n-1 the element (assuming 0 base indexing) and all the elements before it aree in stack (element from 0 to n-2 indexes) and they all have a[i] greater than b[n-1] . so the removal of all elements would be o(n-1) =o(n) [approx] . also the for loop above is of o(n) . so total time complexity :- o(n square).
    plss help

  • @drbardhan4615
    @drbardhan4615 3 หลายเดือนก่อน +1

    Hello bro, Good to see that u r continuing this series. Hope u r doing well.
    I have a question, I started DP about 2 months ago and from the start I use bottom-up approach to solve DP. I dont think of top-down approach first, I just start thinking bottom-up directly coz it feels more intuitive for me to first tackle base case and the create soln over that base. But sometimes I find difficulty finding the dimension of state, like what parameter the state depend on and sometimes transition. Should i first think and start doing top-down or I can go on with bottom-up indefinitely.
    Thnx for your videos!

    • @CPwithShayan
      @CPwithShayan  3 หลายเดือนก่อน +2

      Hi bro,
      Most of times, bottom-up approach works better. There are just some rare cases where you need to do backtrack and hence need to do top-down approach. So, I'll recommend you to feel free to use bottom-up.

    • @drbardhan4615
      @drbardhan4615 3 หลายเดือนก่อน

      @@CPwithShayan Thnx for the reply mate! 🫡

    • @shudhanshusingh1401
      @shudhanshusingh1401 2 หลายเดือนก่อน

      From which country you are bro

  • @piedepew
    @piedepew 3 หลายเดือนก่อน

    Dp ❤❤

  • @ACium.
    @ACium. 3 หลายเดือนก่อน

    Do some problems from timus 🤗

    • @CPwithShayan
      @CPwithShayan  3 หลายเดือนก่อน

      Sure, I'll try.