Блог пользователя dharmenderlodhi186

Автор dharmenderlodhi186, история, 8 лет назад, По-английски

Below are the links to both the problems. https://atcoder.jp/contests/dp/tasks/dp_m

https://atcoder.jp/contests/dp/tasks/dp_j

I have read and re-read the problems again and again but I am not able to understand how to solve these two. I have seen the submissions of other contestants also, even from that I am not able to make much sense. Can you please explain how to approach these problems and suggest similar problems that use the same concept. Thanks

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

Problem M: link
Problem J: link

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Please can someone explain the Approach for J-sushi problem.What should be my dp states. And how to proceed further with that knowledge.

»
6 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Solution to M-Candies here.

Bottom up solution. Prefix sum is calculated to do the transitions in O(1) or else the transitions would have costed O(ai) which will lead to TLE.

»
6 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Errichto has made a video on all the tasks : link

»
6 лет назад, скрыть # |
← Rev. 3  
Проголосовать: нравится 0 Проголосовать: не нравится

Someone reopens the post, so... here is my approach for M-candies

Prefixsum DP - O(sum * k)