{"image_url":null,"url":"https://sune2.hatenadiary.org/entry/20150603/1433349724","width":"100%","categories":["\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0"],"author_name":"sune2","published":"2015-06-03 01:42:04","author_url":"https://blog.hatena.ne.jp/sune2/","version":"1.0","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsune2.hatenadiary.org%2Fentry%2F20150603%2F1433349724\" title=\"Lexicographically Minimal String Rotation (Booth&#39;s Algorithm) - \u7af6\u6280\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0+\u03b1\u306a\u30d6\u30ed\u30b0\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_url":"https://sune2.hatenadiary.org/","height":"190","provider_name":"Hatena Blog","blog_title":"\u7af6\u6280\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0+\u03b1\u306a\u30d6\u30ed\u30b0","description":"\u6982\u8981 \u4f55\u3068\u306a\u304f\u7406\u89e3\u3057\u305f\u306e\u3067\u81ea\u5206\u7528\u306e\u30e1\u30e2 \u6587\u5b57\u5217 s \u3092 cyclic \u306b\u56de\u8ee2\u3055\u305b\u305f\u6642\u306e\u8f9e\u66f8\u9806\u6700\u5c0f\u306e\u6587\u5b57\u5217\u3092\u6c42\u3081\u308b\u554f\u984c\u3092O(n)\u3067\u89e3\u304f \u547c\u3073\u65b9\u304c\u8272\u3005\u3042\u308a\u305d\u3046\u3060\u3051\u3069 Wikipedia \u306e Lexicographically Minimal String Rotation (\u4ee5\u4e0b LMSR) \u3092\u63a1\u7528\u3059\u308bLMSR \u306f Suffix Array \u3067\u3082\u6c42\u3081\u3089\u308c\u305d\u3046\u3060\u3051\u3069\u3053\u3063\u3061\u306e\u307b\u3046\u304c\u52b9\u7387\u3044\u3044\u3060\u308d\u3046\u3057\u6587\u5b57\u5217\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306e\u52c9\u5f37\u3068\u3044\u3046\u3053\u3068\u3067 \u30b3\u30fc\u30c9 int LMSR(const string &s) { string S = s + s; int N = S.size(); vector<int> f(N, \u2026","provider_url":"https://hatena.blog","title":"Lexicographically Minimal String Rotation (Booth's Algorithm)","type":"rich"}