[POJ3096]Surprising Strings 試題描述 The?D-pairs?of a string of letters are the ordered pairs of letters that are distance D from each other. A string is?D-unique?if all of its D-pairs are different. A string is?surprising?if it is D-unique for every poss
Given two strings a and b we define ab to be their concatenation. For example, if a = “abc” and b = “def” then ab = “abcdef”. If we think of concatenation as multiplication, exponentiation by a non-negative integer is defined in the nor