Score : $200$ points
A string $S$ is said to be a substring of a string $T$ when there is a pair of integers $i$ and $j$ ($1 \leq i \leq j \leq |T|)$ that satisfy the following condition.
Let $T$ be the concatenation of $10^5$ copies of oxx
.
Given a string $S$, print Yes
if $S$ is a substring of $T$, and No
otherwise.
o
and x
.Input is given from Standard Input in the following format:
$S$
If $S$ satisfies the condition, print Yes
; otherwise, print No
.
xoxxoxxo
Yes
$T$ begins like this: oxxoxxoxxoxx
...
Since the extraction of $3$-rd through $10$-th characters of $T$ equals $S$, $S$ is a substring of $T$, so Yes
should be printed.
xxoxxoxo
No
Since there is no way to extract from $T$ a string that equals $S$, $S$ is not a substring of $T$, so No
should be printed.
ox
Yes