Time Limit: 1000 ms Memory Limit: 65536 KiB
Two strings s and t of the same length are given. Determine whether it is possible to make t from s using exactly one reverse of some its substring.
A string of length can be encrypted by the following algorithm:
consisting of lowercase Latin letters. Polycarp wants to remove exactly characters ( ) from the string . Polycarp uses the following algorithm times:
Time Limit: 1000 ms Memory Limit: 65536 KiB
辗转相除法是求最大公约数的一种方法,又名欧几里德算法(Euclidean algorithm),求最大公约数的方法还有更相减损法。