What's DP (Dynamic Programming)? [For CP Beginners] (English subtitles)

Поделиться
HTML-код
  • Опубликовано: 21 авг 2024

Комментарии • 33

  • @user-nt5fr8wq6t
    @user-nt5fr8wq6t Месяц назад +11

    とある共テ模試の情報でこれ出たの鬼畜

  • @tiroru394
    @tiroru394 8 месяцев назад +17

    解り易さの極みですやん

  • @fukafuka35
    @fukafuka35 8 дней назад

    究極にわかりやすい!

  • @FlyicCN
    @FlyicCN 2 месяца назад +2

    The best video to introduce DP I've ever seen.

  • @evimalab
    @evimalab  8 месяцев назад +4

    お気軽に質問してください。(動画とそこまで関係なくても構いません。)
    Feel free to ask questions. (Even if they are not very relevant to the video.)

  • @onotomi6328
    @onotomi6328 8 месяцев назад +3

    図の読み取り方はギリギリわかったのですが、図の作り方がわからなかったです。。。
    勉強します!!

    • @evimalab
      @evimalab  8 месяцев назад +2

      すみません、今回は理論のみで一つの話として完結してしまったので、純粋な「お気持ち編」としてコードでの実装は省いてしまいました。
      より実践的な動画を来月作るつもりです。おそらく「DP まとめコンテスト」(atcoder.jp/contests/dp )の解説という形にします。
      なお、このコンテストの4問目(atcoder.jp/contests/dp/tasks/dp_d )が動画で扱ったナップサック問題です。

    • @onotomi6328
      @onotomi6328 8 месяцев назад +1

      ありがとうございます!
      もっと初歩段階でつまづいてまして、、最初の宝石泥棒のナップサック問題を全探索しないで解く為に動的計画法を使ったと思うのですが、、
      その際の有向非巡回グラフの作図の仕方がわからなかったです。。

    • @JD-is8yg
      @JD-is8yg 8 месяцев назад +1

      ​@onotomi6328
      4:56 宝石を好きな順に一列に並べてから、(左から)○番目までの宝石まででぴったり△kgにしたいときの最大金額、を考えてます
      例えば 1円10kg, 2円10kg, 4円20kg の3宝石が並んでいて、ぴったり20kgぶん選ぶなら、1円+2円の組より4円20kg単品のほうがベスト(だから1+2円で20kgにする方法は今後考えない)みたいな感じです
      5:06 ○番目の宝石を拾うなら、その重さぶん斜め下方向に移動するグラフです
      合計4kg以上になる場合は考えないルールにしています

    • @onotomi6328
      @onotomi6328 8 месяцев назад +2

      @@JD-is8yg
      ​​⁠​⁠​ありがとうございます!
      好きな順と全探索のときにやった2通りをそのまま道に図示すれば良いのもわかりました!
      コメント読んでちゃんと動画みたらちゃんと理解できました!

  • @user-xk6es4ni5f
    @user-xk6es4ni5f 3 месяца назад +7

    単位重さあたりの価値の大きい順にして解いたけど、動画の解法の方がほかの問題に応用できていいですね...
    勉強させていただきます✍

    • @snorlaxNK
      @snorlaxNK 3 месяца назад +12

      単位重さあたりの価値が大きい順に足しても正しい答えにならないケースがあります。

    • @Calcogames
      @Calcogames 2 месяца назад

      @@snorlaxNK
      上限10kg
      宝物1:1gで1円
      宝物2:10kgで1000円
      みたいな場合とか?

    • @user-so9by7pb6m
      @user-so9by7pb6m Месяц назад

      正しい答えにならないケースがまあまああるけど、どのみちナップザック問題はNP-Hardだからヒューリスティックな解法の初期値としてとか、いっそのこと不正確なことを承知で見積もるために使うとかの使用法ならアリかも

  • @user-su4qx3tn6t
    @user-su4qx3tn6t 3 месяца назад

    わかりやしー

  • @Ahryno781
    @Ahryno781 Месяц назад

    DP first or graph to learn

  • @RenkoGracia
    @RenkoGracia 8 месяцев назад +2

    will you show more videos of algorithm introduction like this in the future?it really improves my programming idea quickly. and thank you very much!

    • @user-yu8fs7nz8m
      @user-yu8fs7nz8m 8 месяцев назад

      I second that ! maybe you can create a series of programming tutorials covering all algorithms that is being used in programming contests...that will really help us ...Thanks Evima, keep doing what you are doing

  • @yash1152
    @yash1152 2 месяца назад

    5:16 why there's no transition shown from 0,0 to 1,1 (with 20Y), and 1,2 (with 30Y) ??
    oh wait, the DAG given below follows the FA shown above. ohwkay.

  • @numberbasher269
    @numberbasher269 8 месяцев назад

    By "very overview", perhaps you meant "brief overview"?

    • @evimalab
      @evimalab  8 месяцев назад

      I tried to reflect part of the Japanese title "お気持ち編" (literally "Emotional Edition") which meant that the video is not a formal introduction to DP, and it seems I did it wrong. Thanks for letting me know, I'll replace it with something else.

    • @numberbasher269
      @numberbasher269 8 месяцев назад

      "non-technical overview" or just "brief overview" would work, I get what you're trying to say here. @@evimalab

    • @numberbasher269
      @numberbasher269 8 месяцев назад

      To be honest, though, it's probably not required and may be omitted. (Maybe you need a translator for you? But I don't understand Japanese.)

    • @evimalab
      @evimalab  8 месяцев назад

      Thanks for the suggestions! Now that I think about it, it's probably best to just omit it since the title was already quite long. Now the title reads "What's DP (Dynamic Programming)? [For CP Beginners] (English subtitles)," which still uses 71/100 characters.
      Ironically, I'm a (technical) translator at AtCoder without experience of real-life English. When this channel grows, I might eventually need a translator, but I have long, long way to go before that really makes sense :)

    • @evimalab
      @evimalab  8 месяцев назад

      If you have time, could you tell me what was weak about my writing in my first response (the one beginning with "I tried to reflect")? GPT-4 said there was no clear error.

  • @Ahryno781
    @Ahryno781 6 месяцев назад +1

    Feel free to ask questions. (Even if they are not very relevant to the video.)
    I'm confused and distracted by many sheets and roadmaps, if I participate in atcoder-codeforces contests and do upsolve and learn new algorithms in the way , is it a good way to practice and train or I should follow a roadmap or practice on a specific rate and up

    • @evimalab
      @evimalab  6 месяцев назад +1

      I would say you can ignore those "roadmaps."
      The people who made those things most likely have different backgrounds from yours, so they probably don't work too good. If a particular roadmap is working for you, then you can focus on that one thing, but otherwise you can safely forget them. I think in many cases it's best to just participate in contests and learn new techniques "in the way."

    • @yash1152
      @yash1152 2 месяца назад

      ​@@evimalab contests are for improving speed of what you already know. for getting to know concepts in first place, sort the archive of problems in increasing difficulty order, then solve them one by one.
      > _"I think in many cases it's best to just participate in contests and learn new techniques "in the way.""_

  • @DarkKnight-dc6qs
    @DarkKnight-dc6qs 8 месяцев назад +1

    Hi, I have been following your playlist. It would be good if u add some practice problem related to the video topic.
    problems can be from atcoder or anywhere.
    I mean standard / must do problem on that topic

    • @evimalab
      @evimalab  8 месяцев назад +2

      Thanks! Well, for DP I'd recommend Educational DP Contest on AtCoder (atcoder.jp/contests/dp ), which has 26 fairly standard DP problems, the 4th one being the knapsack problem featured in this video. I'll add this to Description. (Actually, I'm planning to make a video that explains this whole contest, maybe next month?)
      Codeforces's problem tags and difficulty sorting may also be useful (codeforces.com/problemset?order=BY_RATING_ASC&tags=dp ), but it may be tricky to find easy problems that actually require DP. (Maybe avoid ones that also have "greedy"?)