#A. B - String Rotation

    传统题 1000ms 256MiB

B - String Rotation

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

B - String Rotation

Score : $200$ points

Problem Statement

You are given string $S$ and $T$ consisting of lowercase English letters.

Determine if $S$ equals $T$ after rotation.

That is, determine if $S$ equals $T$ after the following operation is performed some number of times:

Operation: Let $S = S_1 S_2 ... S_{|S|}$. Change $S$ to $S_{|S|} S_1 S_2 ... S_{|S|-1}$.

Here, $|X|$ denotes the length of the string $X$.

Constraints

  • $2 \leq |S| \leq 100$
  • $|S| = |T|$
  • $S$ and $T$ consist of lowercase English letters.

Input

Input is given from Standard Input in the following format:

SS

TT

Output

If $S$ equals $T$ after rotation, print Yes; if it does not, print No.


kyoto
tokyo
Yes
  • In the first operation, kyoto becomes okyot.
  • In the second operation, okyot becomes tokyo.

abc
arc
No

abc does not equal arc after any number of operations.


aaaaaaaaaaaaaaab
aaaaaaaaaaaaaaab
Yes

2024寒假入门组刷题营(七)

未参加
状态
已结束
规则
ACM/ICPC
题目
8
开始于
2024-2-4 13:30
结束于
2024-2-4 15:30
持续时间
2 小时
主持人
参赛人数
10