(Why so many downvotes? What's wrong with the post?) How would Top Down solution look like for abc220_d?

Revision en5, by ranit, 2021-10-03 11:41:40

Why so many downvotes? What's wrong with the post?

Problem Link: https://atcoder.jp/contests/abc220/tasks/abc220_d

Their official editorial has a bottom-up solution.

I have understood and solved it with the bottom-up approach. I was just curious how would top solution will look like for this problem?

  • I tried, but there seems that I have to invert the modulo operator in here to get to the top-down solution.
  • the dp states and the base case look intuitive, the DP call is not so much.

Found One: https://atcoder.jp/contests/abc220/submissions/26150901

Please enlighten me, if I am missing something in here.

Tags dp, abc220, topdown, help

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en5 English ranit 2021-10-03 11:41:40 70 Found one: https://atcoder.jp/contests/abc220/submissions/26150901
en4 English ranit 2021-10-03 11:25:39 0 (published)
en3 English ranit 2021-10-03 11:06:55 106 Tiny change: 'downvotes?\n\nProbl' -> 'downvotes? What's wrong with the post?\n\nProbl' (saved to drafts)
en2 English ranit 2021-10-03 11:04:50 51 Why so many downvotes?
en1 English ranit 2021-10-02 21:51:28 618 Initial revision (published)