{"width":"100%","author_url":"https://blog.hatena.ne.jp/hamayanhamayan/","description":"https://atcoder.jp/contests/dp/tasks/dp_m \u524d\u63d0\u77e5\u8b58 \u30c7\u30fc\u30bf\u69cb\u9020\u306b\u3088\u308b\u52d5\u7684\u8a08\u753b\u6cd5\u66f4\u65b0\u9ad8\u901f\u5316 \u89e3\u8aac https://atcoder.jp/contests/dp/submissions/3948814dp[i][k] := i\u4eba\u76ee\u306e\u5b50\u4f9b\u307e\u3067\u914d\u308a\u7d42\u3048\u3066\u3001\u6b8b\u308a\u304ck\u500b\u3067\u3042\u308b\u7d44\u307f\u5408\u308f\u305b dp[i][k]\u304b\u3089\u306e\u9077\u79fb\u3092\u8003\u3048\u308b\u3068\u3001i+1\u756a\u76ee\u306e\u5b50\u4f9b\u306f0\uff5eA[i]\u500b\u53d6\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002 \uff08A[i+1]\u304c\u672c\u5f53\u306f\u6b63\u3057\u3044\u304c\u3001A\u306e\u6dfb\u5b57\u30920-indexed\u3068\u8003\u3048\u308b\uff09 rep(i, 0, N) rep(k, 0, K+1) rep(nxt, 0, A[i] + 1) dp[i+1][k-\u2026","height":"190","published":"2019-01-10 23:51:50","type":"rich","categories":["\u7af6\u6280\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0"],"provider_name":"Hatena Blog","provider_url":"https://hatena.blog","url":"https://blog.hamayanhamayan.com/entry/2019/01/10/235150","blog_url":"https://blog.hamayanhamayan.com/","title":"Candies [Educational DP Contest / DP \u307e\u3068\u3081\u30b3\u30f3\u30c6\u30b9\u30c8 M]","blog_title":"\u306f\u307e\u3084\u3093\u306f\u307e\u3084\u3093\u306f\u307e\u3084\u3093","version":"1.0","image_url":null,"author_name":"hamayanhamayan","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.hamayanhamayan.com%2Fentry%2F2019%2F01%2F10%2F235150\" title=\"Candies [Educational DP Contest / DP \u307e\u3068\u3081\u30b3\u30f3\u30c6\u30b9\u30c8 M] - \u306f\u307e\u3084\u3093\u306f\u307e\u3084\u3093\u306f\u307e\u3084\u3093\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>"}