{"author_name":"mayokoex","published":"2016-04-27 14:40:07","author_url":"https://blog.hatena.ne.jp/mayokoex/","title":"square869120Contest #2 E - \u90e8\u5206\u6587\u5b57\u5217","type":"rich","description":"\u554f\u984c s8pc-2.contest.atcoder.jp \u89e3\u6cd5 \u6587\u5b57\u5217\u304c\u5171\u901a\u3057\u3066\u3044\u308b\u5834\u5408, i1 \u304b\u3089\u30b9\u30bf\u30fc\u30c8\u3059\u308b\u6587\u5b57\u5217 i2 \u304b\u3089\u30b9\u30bf\u30fc\u30c8\u3059\u308b\u6587\u5b57\u5217 \u304c\u4e00\u81f4\u3057\u3066\u3044\u308b, \u3068\u3044\u3046\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u3002S[i1:N), S[i2:N) \u306b\u5171\u901a\u6587\u5b57\u5217\u304c\u3042\u308b\u5834\u5408, \u305d\u308c\u3089\u306e\u6587\u5b57\u306f\u8f9e\u66f8\u9806\u7684\u306b\u9023\u7d9a\u3067\u3042\u308b, \u3068\u8003\u3048\u308b\u3068 suffix array -> lcp \u3092\u8003\u3048\u308b\u6d41\u308c\u304c\u51fa\u3066\u304d\u307e\u3059\u3002\u5171\u901a\u3057\u3066\u3044\u308b\u6587\u5b57\u306e\u5206\u306f\u5f8c\u306b\u56de\u3059\u3068\u8003\u3048\u308b\u3068, i \u756a\u76ee\u306e index \u3067\u306f maxi = N-i+1, mini = lcp[i]+1 \u3068\u3057\u3066 (mini+maxi)*(maxi-mini+1)/2 \u3060\u3051\u3053\u306e\u6587\u5b57\u3067\u30ab\u30a6\u30f3\u30c8\u3055\u2026","categories":["AtCoder"],"version":"1.0","provider_name":"Hatena Blog","provider_url":"https://hatena.blog","blog_url":"https://mayokoex.hatenablog.com/","height":"190","width":"100%","blog_title":"mayoko\u2019s diary","url":"https://mayokoex.hatenablog.com/entry/2016/04/27/144007","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmayokoex.hatenablog.com%2Fentry%2F2016%2F04%2F27%2F144007\" title=\"square869120Contest #2 E - \u90e8\u5206\u6587\u5b57\u5217 - 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>","image_url":null}