[CSES][Dynamic Programming] Dice Combinations

Поділитися
Вставка
  • Опубліковано 18 вер 2024
  • cses.fi/proble...
    In this problem we see how memoization and dynamic programming can reduce the complexity of some recursive functions from exponential to linear.

КОМЕНТАРІ • 28

  • @aankie
    @aankie День тому

    You are the best tutor in the world

  • @amirghorban2044
    @amirghorban2044 3 роки тому +1

    best channel for practicing cses problem

  • @ChandraShekhar-by3cd
    @ChandraShekhar-by3cd 2 роки тому +2

    Thanks for such a great visualization!

  • @adhrit1426
    @adhrit1426 2 роки тому

    Explanation was gold! Thank you

  • @masaftic
    @masaftic 2 роки тому +1

    thank you so much for making these solutions

  • @alisalimli
    @alisalimli 2 роки тому +1

    Thanks !

  • @AmanKumar-nj5sz
    @AmanKumar-nj5sz 2 роки тому +1

    I have found your channel very helpful.

  • @tonymontana-qd1xi
    @tonymontana-qd1xi Рік тому

    amazing video

  • @bldouyin4145
    @bldouyin4145 2 роки тому

    Nice thx u:3

  • @rudeus132
    @rudeus132 2 роки тому +1

    Can you explain what you mean by 5 additions?

    • @neatlystructured
      @neatlystructured  2 роки тому +1

      In this problem, dp[i] depends on the 6 previous values: dp[i-1], .... , dp[i-6]. and we need 5 additions to sum them up. In general, if you have n values, u need n-1 additions to sum them up.

    • @rudeus132
      @rudeus132 2 роки тому

      @@neatlystructured thank you!

  • @nurbektaizhanov4534
    @nurbektaizhanov4534 2 роки тому

    Sorry, but i have question. Why you use mod in code? Why we need it? Thanks for tut

    • @thuanlevan9568
      @thuanlevan9568 Рік тому

      because the answer might be too large for long long or int to store

  • @belaluddin6554
    @belaluddin6554 Рік тому

    For 10, we consider 9,8,7,6,5 and 4.. why don't we consider the rest?

    • @caiodavi9829
      @caiodavi9829 Рік тому

      because the dice can be 1, 2, 3, 4, 5 or 6. it cant be greater than that

  • @HITNUT
    @HITNUT 2 роки тому +1

    eggrice