102301: [AtCoder]ABC230 B - Triple Metre

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Score : $200$ points

Problem Statement

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.

  • The extraction of the $i$-th through $j$-th characters of $T$ without changing the order equals $S$.

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.

Constraints

  • $S$ is a string consisting of o and x.
  • The length of $S$ is between $1$ and $10$ (inclusive).

Input

Input is given from Standard Input in the following format:

$S$

Output

If $S$ satisfies the condition, print Yes; otherwise, print No.


Sample Input 1

xoxxoxxo

Sample Output 1

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.


Sample Input 2

xxoxxoxo

Sample Output 2

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.


Sample Input 3

ox

Sample Output 3

Yes

Input

题意翻译

有两个字符串 $s,t$ ,其中 $s$ 由输入给出, $t$ 为 `oxxoxxoxxoxx` ... ( `oxx` 重复 $10^5$ 遍 )。问 $s$ 是否是 $t$ 的子串?

Output

分数:200分

问题描述

当存在一对整数 i 和 j(1≤i≤j≤|T|)满足以下条件时,字符串 S 称为字符串 T 的子串。

  • 在不改变顺序的情况下提取 T 的第 i 个到第 j 个字符等于 S。

让 T 是oxx的 10^5 次连接。
给定一个字符串 S,如果 S 是 T 的子串,则打印Yes,否则打印No

约束

  • S 是由ox组成的字符串。
  • S 的长度在 1 到 10(含)之间。

输入

输入通过标准输入以以下格式给出:

$S$

输出

如果 S 满足条件,则打印Yes;否则打印No


样例输入 1

xoxxoxxo

样例输出 1

Yes

T 开头如下:oxxoxxoxxoxx... 由于提取 T 的第 3 个到第 10 个字符等于 S,因此 S 是 T 的子串,因此应该打印Yes


样例输入 2

xxoxxoxo

样例输出 2

No

由于无法从 T 中提取等于 S 的字符串,因此 S 不是 T 的子串,因此应该打印No


样例输入 3

ox

样例输出 3

Yes

加入题单

算法标签: