#abc230b. B - Triple Metre
B - Triple Metre
Score : points
问题描述
设一串字符串 被称为字符串 的子串,当存在一对整数 和 (满足 ),且满足以下条件时。
- 从第 个到第 个字符不改变顺序地提取出的 中的子序列等于 。
令 为 oxx
连接而成的重复 次的字符串。
给定一个字符串 ,如果 是 的子串,则输出 Yes
,否则输出 No
。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
A string is said to be a substring of a string when there is a pair of integers and ( that satisfy the following condition.
- The extraction of the -th through -th characters of without changing the order equals .
Let be the concatenation of copies of oxx
.
Given a string , print Yes
if is a substring of , and No
otherwise.
Constraints
- is a string consisting of
o
andx
. - The length of is between and (inclusive).
Input
Input is given from Standard Input in the following format:
Output
If satisfies the condition, print Yes
; otherwise, print No
.
Sample Input 1
xoxxoxxo
Sample Output 1
Yes
begins like this: oxxoxxoxxoxx
... Since the extraction of -rd through -th characters of equals , is a substring of , so Yes
should be printed.
Sample Input 2
xxoxxoxo
Sample Output 2
No
Since there is no way to extract from a string that equals , is not a substring of , so No
should be printed.
Sample Input 3
ox
Sample Output 3
Yes
update @ 2024/3/10 10:02:53
相关
在下列比赛中: