{"author_url":"https://blog.hatena.ne.jp/mayokoex/","height":"190","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmayokoex.hatenablog.com%2Fentry%2F2016%2F03%2F31%2F235502\" title=\"VK Cup 2016 - Round 1 D. Bear and Contribution - mayoko\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>","type":"rich","url":"https://mayokoex.hatenablog.com/entry/2016/03/31/235502","width":"100%","author_name":"mayokoex","blog_url":"https://mayokoex.hatenablog.com/","categories":["CodeForces"],"title":"VK Cup 2016 - Round 1 D. Bear and Contribution","description":"\u554f\u984c codeforces.com \u89e3\u6cd5 \u307e\u305a\u5358\u7d14\u306a\u89e3\u6cd5\u3092\u8003\u3048\u3066\u307f\u307e\u3059\u3002\u76ee\u6a19\u306b\u306a\u308b\u5024\u3092\u6c7a\u3081\u308b\u3068, \u5404\u5024(vals \u3068\u3044\u3046\u914d\u5217\u306b\u307e\u3068\u3081\u3066\u304a\u304f\u3053\u3068\u306b\u3057\u307e\u3059)\u3092\u76ee\u6a19\u306e\u5024\u306b\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u306a\u30b3\u30b9\u30c8\u304c\u6c7a\u5b9a\u3057\u307e\u3059(t \u3060\u3051 contribution \u3092\u5897\u3084\u3057\u305f\u3044\u3068\u3059\u308b\u3068, t/5 * c1 + (t%5)*c \u304c\u304b\u304b\u308b\u30b3\u30b9\u30c8\u306e\u6700\u5c0f\u5024(c1 \u306f 5 \u5897\u3084\u3059\u306e\u306b\u5fc5\u8981\u306a\u30b3\u30b9\u30c8, c \u306f 1 \u5897\u3084\u3059\u306e\u306b\u5fc5\u8981\u306a\u30b3\u30b9\u30c8))\u3002\u306a\u306e\u3067, n \u4eba\u305d\u308c\u305e\u308c\u306e contribution \u3092\u8abf\u3079\u308c\u3070, \u5404\u76ee\u6a19\u5024\u306b\u5bfe\u3057\u3066 O(N) \u3067\u30b3\u30b9\u30c8\u3092\u8abf\u3079\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067, \u6642\u9593\u306f\u304b\u304b\u308b\u3051\u3069\u7b54\u3048\u306f\u5f97\u3089\u308c\u305d\u3046\u3067\u3059\u3002\u307e\u305f, \u76ee\u6a19\u5024\u3068\u3057\u3066\u3042\u308a\u5f97\u308b\u2026","version":"1.0","provider_url":"https://hatena.blog","provider_name":"Hatena Blog","blog_title":"mayoko\u2019s diary","published":"2016-03-31 23:55:02","image_url":null}