Logo
(追記) (追記ここまで)

19605번 - Cyclic Shifts 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB24417414470.588%

문제

Thuc likes finding cyclic shifts of strings. A cyclic shift of a string is obtained by moving characters from the beginning of the string to the end of the string. We also consider a string to be a cyclic shift of itself. For example, the cyclic shifts of ABCDE are:

ABCDE, BCDEA, CDEAB, DEABC, and EABCD.

Given some text, T, and a string, S, determine if T contains a cyclic shift of S.

입력

The input will consist of exactly two lines containing only uppercase letters. The first line will be the text T, and the second line will be the string S. Each line will contain at most 1000 characters.

출력

Output yes if the text, T, contains a cyclic shift of the string, S. Otherwise, output no.

제한

예제 입력 1

ABCCDEABAA
ABCDE

예제 출력 1

yes

CDEAB is a cyclic shift of ABCDE and it is contained in the text ABCCDEABAA.

예제 입력 2

ABCDDEBCAB
ABA

예제 출력 2

no

The cyclic shifts of ABA are ABA, BAA, and AAB. None of these shifts are contained in the text ABCDDEBCAB.

힌트

출처

Olympiad > Canadian Computing Competition & Olympiad > 2020 > CCC 2020 Junior Division 4번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /