{"blog_title":"yama2_0506\u2019s diary","provider_name":"Hatena Blog","version":"1.0","author_url":"https://blog.hatena.ne.jp/yama2_0506/","categories":[],"type":"rich","width":"100%","height":"190","blog_url":"https://yama2-0506.hatenablog.com/","author_name":"yama2_0506","provider_url":"https://hatena.blog","url":"https://yama2-0506.hatenablog.com/entry/2022/04/20/085210","title":"\uff08\u5099\u5fd8\u9332\uff09\u554f\u984c\u89e3\u6c7a\u306e\u305f\u3081\u306e\u300c\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u6570\u5b66\u300d\u301c 8","published":"2022-04-20 08:52:10","image_url":null,"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyama2-0506.hatenablog.com%2Fentry%2F2022%2F04%2F20%2F085210\" title=\"\uff08\u5099\u5fd8\u9332\uff09\u554f\u984c\u89e3\u6c7a\u306e\u305f\u3081\u306e\u300c\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u6570\u5b66\u300d\u301c 8 - yama2_0506\u2019s diary\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","description":"\u554f\u984c atcoder.jp \u81ea\u5206\u306e\u56de\u7b54 \u66f8\u7c4d\u306b\u66f8\u3044\u3066\u3042\u308b\u56de\u7b54\u306e\u624b\u5f15\u304d\u898b\u3066\u5185\u5bb9\u7406\u89e3\u3057\u3066\u3066\u3082\u3044\u3056\u5b9f\u88c5\u3059\u308b\u3068\u96e3\u3057\u3044\u3002\u3002\u3002 \u3053\u308c\u3082\u4ed6\u306e\u65b9\u306e\u56de\u7b54\u898b\u3066\u53c2\u8003\u306b\u3057\u3066\u3044\u307e\u3059 N,W = gets.split.map(&:to_i) # \u5165\u529b\u3092\u683c\u7d0d\u3059\u308b\u914d\u5217 WN = Array.new N.times do WN << gets.split.map(&:to_i) end # \u52d5\u7684\u8a08\u753b\u6cd5 dp = Array.new dp[0]=Array.new(W+1,0) # \u5546\u54c1\u3092each(\u6700\u5f8c\u306e\u5206\u306f\u542b\u307e\u306a\u3044\uff09 (0...N).each do |i| dp[i+1] = Array.new # \u91cd\u3055\u3092each (0..W\u2026"}