# 「POJ-1523」Power Strings-KMP

Given two strings a and b we define ab to be their concatenation. For example, if a = “abc” and b = “def” then a*b = “abcdef”. If we think of concatenation as multiplication, exponentiation by a non-negative integer is defined in the normal way: a^0 = “” (the empty string) and a^(n+1) = a(a^n).

POJ-2406

### 题解

KMP 求循环节，KMP 时 $j - m$ 为循环节长度，接下来用除法或取模就能判断了。