TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: 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.

Submission attempts (in order):
import numpy as np

s = list(input())
t = list(input())

i = 0
if len(s) != len(t):
    print("No")
else:
    while True:
        s = np.roll(s,-1)
        i += 1
        if s == t:
            print("Yes")
            break
        elif i >= len(s):
            print("No")
            break


import numpy as np

s = list(input())
t = list(input())

i = 0
while True:
    s = list(np.roll(s,-1))
    i += 1
    if s == t:
        print("Yes")
        break
    elif i >= len(s):
        print("No")
        break


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
s = input()
t = input()

flag = 0

for i in range(len(s)):
    s1 = s[0:-1]
    s2 = s[-1]
    s = s2 + s1
    print(s)
    if(s == t):
        flag = 1
        break

if(flag == 1):
    print("Yes")
else:
    print("No")

s = input()
t = input()

flag = 0

for i in range(len(s)):
    s1 = s[0:-1]
    s2 = s[-1]
    s = s2 + s1
    if(s == t):
        flag = 1
        break

if(flag == 1):
    print("yes")
else:
    print("No")

s = input()
t = input()

flag = 0

for i in range(len(s)):
    s1 = s[0:-1]
    s2 = s[-1]
    s = s2 + s1
    if(s == t):
        flag = 1
        break

if(flag == 1):
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
S = input()
T = input()

flag = False
s_tmp = S
for cnt in range(len(s)):
    s_tmp = s_tmp[-1] + s_tmp[:-1]
    if s_tmp == T:
        flag = True
        break

if flag:
    print("Yes")
else:
    print("No")

S = input()
T = input()

flag = False
s_tmp = S
for cnt in range(len(S)):
    s_tmp = s_tmp[-1] + s_tmp[:-1]
    if s_tmp == T:
        flag = True
        break

if flag:
    print("Yes")
else:
    print("No")

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
import collections

S = list(input())
T = list(input())

for i in range(len(S)):
	tmp = S[i:] + [:i]
	if T == tmp:
		print('Yes')
		break
print('No') 

S = list(input())
T = list(input())

for i in range(len(S)):
	tmp = S[i:] + [:i]
	if T == tmp:
		print('Yes')
		break
print('No') 

S = list(input())
T = list(input())

for i in range(len(S)):
	tmp = S[i:] + S[:i]
	if T == tmp:
		print('Yes')
		exit()
print('No') 

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
S = input()
T = input()
flg = True
for i in range(0,len(S)):
    if S == T:
        print('Yes')
        break
    else:
        T = T[len(T)]+T[1:]
else:
    print('No')


S = input()
T = input()

for i in range(0,len(S)):
	if S[i] == T[-i]:
		continue
	else:
		print('No')
		return

print('Yes')


S = input()
T = input()
flg = True
for i in range(0,len(S)):
    if S[i] == T[-i]:
        continue
    else:
        print('No')
        flg = False

if flg:
    print('Yes')


S = input()
T = input()

for i in range(0,len(S)):
	if S[i] == T[-i]:
		continue
	else:
		print('No')
		break
else:
	print('Yes')

S = input()
T = input()

for i in range(0,len(S)):
    if S == T:
        print('Yes')
        break
    else:
        T = T[len(T)-1]+T[1:]
else:
    print('No')


S = input()
T = input()
flg = True
for i in range(0,len(S)):
    if S[i] == T[-i]:
        continue
    else:
        print('No')
        flg = False
        break

if flg:
    print('Yes')


S = input()
T = input()

for i in range(0,len(S)):
    if S == T:
        print('Yes')
        break
    else:
        T = T[len(T)-1]+T[0:len(T)-1]
else:
    print('No')


Verdicts: Runtime Error

Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s = input()
t = input()

for _ in range(len(s)):
  if s[-1] + s[0:-1] == t:
    print('Yes')
    exit()
print('No')

s = input()
t = input()

for _ in range(len(s)):
  s = s[-1] + s[0:-1] 
  if s == t:
    print('Yes')
    exit()
print('No')


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s = input()
t = input()
ans_flag = False
for i in range(len(s)):
    if s == t:
        print("Yes")
        ans_flag = True
        break
    else:
        s = s[1:] + s[0]
        print(s)
if ans_flag == False:
    print("No")

s = input()
t = input()
ans_flag = False
for i in range(len(s)):
    if s == t:
        print("Yes")
        ans_flag = True
        break
    else:
        s = s[1:] + s[0]
if ans_flag == False:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s,t=input().split()
for i in range(1,len(s)+1):
  if t==s[-i:]+s[:-i]:
    print('Yes')
    exit()
print('No')

s=input()
t=input()
for i in range(1,len(s)+1):
  if t==s[-i:]+s[:-i]:
    print('Yes')
    exit()
print('No')

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
A = input()
B = input()
A=sorted(A)
B=sorted(B)
if A == B:
  print('Yse')
else:
  print('No')

A = input()
B = input()
t = False
for a in range(len(A)):
  k=A[a:len(A)]+A[:a]
  if k == B:
    t = True
    break;
    
if t:
  print('Yes')
else:
  print('No')

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s = input()
t = input()

for _ in range(len(s)):
    if s = t:
        print('Yes')
        exit()
    s = s[-1]+s[:-1]
print('No')

s = input()
t = input()

for _ in range(len(s)):
    if s == t:
        print('Yes')
        exit()
    s = s[-1]+s[:-1]
print('No')


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
S = list(input())
T = list(input())

change = []
flag = 0
get = 0

for i in range(len(S)):
  if S[0] == T[i]:
    get = 1
    for j in range(len(S) - i):
      change.append(T[j+i])
    for k in range(i):
      change.append(T[k])
      
if get == 1:
	for check in range(len(S)):
  		if S[check] != change[check]:
    		flag = 1

if flag == 1:
  print("No")
else:
  print("Yes")

Spr = input()
T = list(input())
S = list(Spr)

change = ""
ok = 0

for i in range(len(S)):
  if S[0] == T[i]:
    for j in range(len(S) - i):
      change += T[j+i]
    for k in range(i):
      change += T[k]
    if Spr == change:
      if ok == 0:
      	print("Yes")
      	ok = 1
    change = ""

if i == len(S) - 1 and ok == 0:
  print("No")    

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
s=input()
t=input()
for i in range(200):
  s=s[-1]+s[:-1]
  if s==t:print("Yes")
print("No")

s=input()
t=input()
for i in range(200):
  s=s[-1]+s[:-1]
  if s==t:print("Yes");exit()
print("No")

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s = input()
t = input()
c = 0
a_list =[]
while c < len(t):
  a_list.append(t)
  a = t.pop(0)
  t.append(a)
  c += 1
if s in a_list:
  print('Yes')
else:
  print('No')

s = input()
t = input()
c = 0
a_list =[]
while c < len(t):
  a_list.append(t)
  a = t[1:]+t[0:1]
  t = a
  c += 1
if s in a_list:
  print('Yes')
else:
  print('No')


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
S = input()
T = input()
S = sorted(S)
print(S)
T = sorted(T)
print(T)
if S == T:
    print("Yes")
else:
    print("No")

S = input()
T = input()
text = "No"
import array
for c in S:
    if S == T:
        text = "Yes"
        break
    S = S[-1] + S[:-1]
print(text)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s = input()
t = input()
if s == t:
    print('Yes')
    exit()
    
s_num=len(s)
for i in range(s_num):
    s = s[-1] + s[: s_num - 1]
    if s == t:
        print('Yes')
print('No')


s = input()
t = input()
if s == t:
    print('Yes')
    exit()

s_num=len(s)
for i in range(s_num):
    s = s[-1] + s[: s_num - 1]
    if s == t:
        print('Yes')
        exit()
print('No')


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import sys
S1=str(input())
S2=str(input())
NG = False
for i in range(len(S1)):
  S1.append(S1[0])
  del S1[0]
  if S1 == S2:
    print('Yes')
    NG = True
    break
if NG:
  print('No')

import sys
S1=str(input())
S2=str(input())
for i in range(len(S1)):
  S1.append(S1[0])
  del S1[0]
  if S1 == S2:
    print('Yes')
    sys.exit()
print('No')

S1=str(input())
S2=str(input())
for i in range(len(S1)):
  S1.append(S1[0])
  del S1[0]
  if S1 == S2:
    print('Yes')
    return
print('No')


S1=str(input())
S2=str(input())
NG = True
for i in range(len(S1)):
  if S1 == S2[i:len(S1)]+S2[0:i]:
    print('Yes')
    NG = False
    break
if NG:
  print('No')


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
s = input()
t = input()
x = ""
if s==t:
  print('Yes')
else:
  for i in range(len(s)):
    if s[i]==t[0]:
      for j in range(i,len(s)):
        x += s[j]
      for k in range(i):
        x += s[k]
        break
  print('Yes' if x==t else 'No')

s = input()
t = input()
x = ""
if s==t:
  print('Yes')
else:
  for i in range(len(s)):
    if s[i]==t[0] and i!=len(s)-1 and s[i+1]==t[1]:
      for j in range(i,len(s)):
        x += s[j]
      for k in range(i):
        x += s[k]
      print(x,end='\n')
      break
  print('Yes' if x==t else 'No')

print('Yes' if input() in input()*2 else 'No')

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
S = input()
T = input()
if s in T*2:
    print("Yes")
else:
    print("No")

S = input()
T = input()
if S in T*2:
    print("Yes")
else:
    print("No")

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
S = input()
T = input()
print("Yes") if S[::-1] == T else print("No")

S = list(input())
T = list(input())
count = 0
for i in range(len(S)):
    if S == T:
        count += 1
    S.append(S[0])
    del S[0]
if count > 0:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
英小文字からなる文字列S,Tが与えられます。Sを回転させてTに一致させられるか判定してください。
すなわち、以下の操作を任意の回数繰り返してSをTに一致させられるか判定してください。
操作:S=S1S2...S|S|のとき、SをS|S|S1S2...S|S|−1に変更する
ここで、|X|は文字列Xの長さを表します。
"""

s = input()
t = input()

s = list(s)
t = list(t)


count = 0
judgment = 0


while count <= len(s)+1:
    item = s.pop()
    s.insert(0,item)
    if s == t:
        
        judgment += 1
    
    count +=1


if judgment == 0:
    print("No")
else:
    print("Yes")

s = input()
t = input()

s = list(s)
t = list(t)


count = 0
judgment = 0


while count <= len(s):
    item = s.pop()
    s.insert(0,item)
    if s == t:
        
        judgment += 1
    
    count +=1


if judgment == 0:
    print("No")
else:
    print("Yes")

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
#103b
s=list(input())
t=list(input())

if s==t:
    print('Yes')
    exit()
for i in range(len(s)):
    s.insert(0,s[-1])
    del s[-1]
    if s==t:
        print('Yes')
        break
        exit()
print('No')
        
    

#103b
s=list(input())
t=list(input())

if s==t:
    print('Yes')
    exit()

for _ in range(len(s)):
    s.insert(0,s[-1])
    del s[-1]
    if s==t:
        print('Yes')
        exit()
print('No')
        
    

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *


def lcm(x, y):
    return (x * y) // math.gcd(x, y)


if __name__ == '__main__':
    s = input()
    t = input()

    if s == t or s[::-1] ==t:
        print("Yes")
    else:
        print("No")

import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *


def lcm(x, y):
    return (x * y) // math.gcd(x, y)


if __name__ == '__main__':
    s = input()
    t = input()

    for i in range(len(s)):
        if s[i:]+s[:i] == t:
            print("Yes")
            break
        if i == len(s)-1:
            print("No")


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s = input()
t = input()
if s == t:
    print("Yes")
    quit()
for i in range(1,len(s)):
    s_remain = s[:len(s)-i]
    s_tofront = s[len(s)-i:]
    print(s_tofront + s_remain)
    if s_tofront + s_remain == t:
        print("Yes")
        quit()
print("No")

s = input()
t = input()
for i in range(len(s)):
    s_remain = s[:len(s)-i]
    s_tofront = s[len(s)-i:]
    if s_tofront + s_remain == t:
        print("Yes")
        quit()
print("No")

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
A = input()
B = input()
for i in range(len(A)):
　　if(A == B):
　　　　print("Yes")
　　　　exit()
　　A = (A+A[0])[1:]
print("No")


A = input()
B = input()
for i in range(len(A)):
if(A == B):
　　print("Yes")
　　exit()
　　A = (A+A[0])[1:]
print("No")


A = input()
B = input()
for i in range(len(A)):
　　if A == B:
　　　　print("Yes")
　　　　exit()
　　A = (A+A[0])[1:]
print("No")


A = input()
B = input()
for i in range(len(A)):
    if A == B:
        print("Yes")
        exit()
    A = (A+A[0])[1:]
print("No")

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
s = input()
t = input()
ans = "No"
for i in range(len(s)):
  if s == t:
    ans = "Yes"
    break
  else:
    s = s[1]+s
    s = s[:-1]
print(ans)
    

s = input()
t = input()
ans = "No"
for i in range(len(s)):
  if s == t:
    ans = "Yes"
    break
  else:
    s = s[-1]+s
    s = s[:-1]
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s = input()
t = input()
ans = False
#tests = s
for i in range(len(s)):
    print(s)
    if s == t:
        ans = True
        break
    s = s[-1] + s[0 : len(s) - 1]

if ans:
    print("Yes")
else:
    print("No")

s = input()
t = input()
ans = False
#tests = s
for i in range(len(s)):
    #print(s)
    if s == t:
        ans = True
        break
    s = s[-1] + s[0 : len(s) - 1]

if ans:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s = list(input())
t = list(input())
f = False
l = len(s)
p = ["" for _ in range(l)]
for i in range(l):
	if s == p: 
		print("as")
		f = True
		break
	for j in range(l):
		p[(j+i)%l] = t[j]
if f: print("Yes")
else: print("No")

s = list(input())
t = list(input())
f = False
l = len(s)
p = ["" for _ in range(l)]
if s == t: f = True
for i in range(l):
	for j in range(l):
		p[(j+i)%l] = t[j]
	if s == p: 
		f = True
if f: print("Yes")
else: print("No")

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s = input()
t = input()
for _ in range(len(s)):
    s = s[len(s)-1]+"".join[s[i] for i in range(len(s)-1)]
    if s == t:
        print("Yes")
        exit()
        
print("No")

s = input()
t = input()
cnt = 1
for _ in range(len(s)):
    a = s[len(s)-1]
    b = [s[i] for i in range(len(s)-1)]
    bb = "".join(b)
    s = a+bb
    if s == t:
        cnt *= 0

print("No") if cnt else print("Yes")

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
for i in S:
    s = ''
    x = i
    s += S[1::1]
    s += x
    S = S[1::1] + S[0]
    
    if s == T:
        print('Yes')
        break
else:
    print('No')



def match_rotation(s,t):
    for i in s:
        s = s[1::] + s[0]
        if s == t:
            return 'Yes'
    else:
        return 'No'


S = str(input())
T = str(input())


print(match_rotation(S, T))

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
from collections import deque
S = input()
T = input()

s = deque(list(S))
t = deque(list(T))

n = len(s)
for i in range(n):
    if t == s:
        print("yes")
        break
    a = t.popleft()
    t.append(a)
else:
    print("no")


from collections import deque
S = input()
T = input()

s = deque(list(S))
t = deque(list(T))

n = len(s)
for i in range(n):
    if t == s:
        print("Yes")
        break
    a = t.popleft()
    t.append(a)
else:
    print("No")


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
S = input()
T = input()

flag = False
for i in range(len(S)):
    T = T[1:] + T[:1]
    print(T)
    if S == T:
        flag = True
        break

print('Yes' if flag else 'No')



S = input()
T = input()

flag = False
for i in range(len(S)):
    T = T[1:] + T[:1]
    if S == T:
        flag = True
        break

print('Yes' if flag else 'No')



Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):


import numpy as np

S=np.asarray(list(input()))
T=np.asarray(list(input()))
OKflag=False 

for i in range(len(S)):
    Sr=np.roll(S,i) 
    
    if Sr==T: 
        OKflag=True
        break

if OKflag==True: 
    print("Yes")
else: 
    print("No")



import numpy as np

S=np.asarray(list(input()))
T=np.asarray(list(input()))
OKflag=False 

for i in range(len(S)):
    Sr=np.roll(S,i) 
    
    if (Sr==T).all(): 
        OKflag=True
        break

if OKflag==True: 
    print("Yes")
else: 
    print("No")

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
import sys
S = list(input())
T = list(input())
for i in range(len(S)):
    if S == T:
        print("Yes")
        sys.exit(0)
    l = S[1:] + list(l[0])
print("No")

import sys
S = list(input())
T = list(input())

for i in range(len(S)):
    if S == T:
        print("Yes")
        sys.exit(0)
    S = S[1:] + list(S[0])
print("No")

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
a = input()
b = input()

if (len(a) != len(b)):
  print("NO")
  exit(0)
for i in range(len(a)):
  if a[i:] + a[:i] == b:
    print("YES")
    exit(0)
print("NO")

a = input()
b = input()
 
if (len(a) != len(b)):
  print("No")
  exit(0)
for i in range(len(a)):
  if a[i:] + a[:i] == b:
    print("Yes")
    exit(0)
print("No")

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
def spaceinput():
    return list(map(int,input().split(" ")))

def rotate(s):
    return s[-1]+s[:-1]

s=input()
s2=input()

def chk(s,s2):
    for i in range(len(s)):
        print(s2)
        if s==s2:
            return True
        s2=rotate(s2)
        print(s2)
    return False

if chk(s,s2):
    print("Yes")
else:
    print("No")


def spaceinput():
    return list(map(int,input().split(" ")))

def rotate(s):
    return s[-1]+s[:-1]

s=input()
s2=input()

def chk(s,s2):
    for i in range(len(s)):
        #print(s2)
        if s==s2:
            return True
        s2=rotate(s2)

    return False

if chk(s,s2):
    print("Yes")
else:
    print("No")


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
S=list(input())
T=list(input())
S=S+S
ans='No'
fot i in range(len(T)):
  if S[i:len(T)]==T:
    ans='Yes'
    break
print(ans)

S=list(input())
T=list(input())
S=S+S
ans='No'
for i in range(len(T)):
  if S[i:len(T)+i]==T:
    ans='Yes'
    break
print(ans)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
s=input()
t=input()
result=='No'
for i in range(len(s)-1):
  s=s[-1]+s[:len(s)-1]
  if s==t:
    result='Yes'
print(result)

s=input()
t=input()
result='No'
for i in range(len(s)):
  s=s[-1]+s[:len(s)-1]
  if s==t:
    result='Yes'
print(result)


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
s = list(input())
t = list(input())
for i in range(len(s)):
    if s == t:
        print('Yes')
        exit(0)
    a = s[-1]
    s.pop(0)
    s.append(a)
print('No')

s = list(input())
t = list(input())
for i in range(len(s)):
    if s == t:
        print('Yes')
        exit(0)
    a = s[0]
    s.pop(0)
    s.append(a)
print('No')

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s, t = (input() for _ in range(2))
tmp = t
if s == tmp:
  print('Yes')
  exit()
if set(s) == set(t):
  for i in range(len(s)):
    tmp = tmp[-1] + tmp[:-1]
    print(tmp)
    if tmp == t:
      print('Yes')
      exit()
print('No')

print("Yes" if input() in input()*2 else "No")

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s = list(input())
t = list(input())
for i in range(len(s)):
  check = True:
    for j in range(len(s)):
      if t[j] != s[(i+j)%len(s)]:
        check = False
    if check:
      print("Yes")
      exit()
      
print("No")

s = list(input())
t = list(input())
for i in range(len(s)):
  check = True
  for j in range(len(s)):
    if t[j] != s[(i+j)%len(s)]:
      check = False
  if check:
    print("Yes")
    exit()
      
print("No")


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
s=str(input())
t=str(input())
ans='No'
if s==t:
  ans='Yes'
for i in range(len(s)):
  s.append(s[0])
  if s==t:
    ans='Yes'
print(ans)


s=list(input())
t=str(input())
ans='No'
for i in range(len(s)):
  s.append(s[0])
  if "".join(s)==t:
    ans='Yes'
print(ans)


s=list(input())
t=str(input())
for i in range(len(s)):
  s.append(s[0])
  if "".join(s)==t:
    print('Yes')
    break
else:
  print('No')

s=list(input())
t=str(input())
ans='No'
if ''.join(s)==t:
  ans='Yes'
for i in range(len(s)):
  s.append(s.pop(0))
  if ''.join(s)==t:
    ans='Yes'
print(ans)

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s = input()
t = input()

for i in range(len(s)):
  s = s[-1]+s[0:len(s)-1]
  print(s)
  if s == t:
    print('Yes')
    exit()

print('No')

s = input()
t = input()

for i in range(len(s)):
  s = s[-1]+s[0:len(s)-1]
  if s == t:
    print('Yes')
    exit()

print('No')


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s=input()
t=input()
for i in range(len(s)):
    if s[-i-1:0]+s[0:-i-1]==t:
        print('Yes')
        exit()
print('No')

s=input()
t=input()
for i in range(len(s)):
    if s[-i-1:-1]+s[-1]+s[0:-i-1]==t:
        print('Yes')
        exit()
print('No')


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a=input()
b=input()
com=a
for i in range(len(a)):
  com=com[1:]+com[0]
  if com==b:
    print("yes")
    break
if com!=b:
  print("no")

a=input()
b=input()
com=a
for i in range(len(a)):
  com=com[1:]+com[0]
  if com==b:
    print("Yes")
    break
if com!=b:
  print("No")


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):

def B():
    s1 = input()
    s2 = input()
    
    YES = 'Yes'
    NO = 'No'
    
    s1list = [a for a in s1]
    s2list = [a for a in s2]
    s1list.sort()
    s2list.sort()
    
    result = YES
    for(a1,a2) in zip(s1list,s2list):
        print(a1 is a2)
            #result = NO
    print(result)

if __name__ =='__main__':
    B()


def B():
    s1 = input()
    s2 = input()
    
    YES = 'Yes'
    NO = 'No'
    
    s1list = [a for a in s1]
    s2list = [a for a in s2]
    s1list.sort()
    s2list.sort()
    
    result = YES
    for(a1,a2) in zip(s1list,s2list):
        print(a1 is a2)
            #result = NO
    print(result)

if __name__ =='__main__':
    B()

def B():
    s1 = input()
    s2 = input()
    
    YES = 'Yes'
    NO = 'No'
    
    result = NO
    for i in range(len(s1)):
        p = s1[i:] + s1[:i]
        if(p in s2):
            result = YES
    
    print(result)
        
if __name__ =='__main__':
    B()

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import sys

S = list(input())
T = list(input())
s = S

if S == T:
    print("Yes")
    sys.exit()

S.insert(0, S[-1])
S.pop(-1)

while True:
    if S == T:
        print("Yes")
        break
    elif S == s:
        print("No")
        break
    else:
        S.insert(0, S[-1])
        S.pop(-1)

import sys

S = list(input())
T = list(input())

for _ in range(len(S)):
    if S == T:
        print("Yes")
        sys.exit()
    else:
        S.insert(0, S[-1])
        S.pop(-1)

print("No")

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import sys

s = input()
t = input()
for i in range(len(s)):
    s = s[-1] + s[:-1]
    print(s)
    if t == s:
        print('Yes')
        sys.exit(1)
print('No')


import sys

s = input()
t = input()
n = len(s)
for i in range(n):
    for j in range(n):
        if s[j] == t[(i + j) % n]:
            continue
        else:
            break
    else:
        print('Yes')
        sys.exit(0)
    continue
print('No')


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
import sys
s = input()
t = input()

for i in range(len(s)):
    if s == t:
        print("Yes")
        sys.exit()
    else:
        tmp = s[0]
        del s[0]
        s = s + tmp
print("No")

import sys
s = input()
t = input()

if all(s.count(t[i]) ==1 for i in range(len(t))):
    print("Yes")
else:
    print("No")

import sys
s = set(input())
t = set(input())

if len(s) != len(t):
    print("No")
    sys.exit()

if all(s.count(t[i]) ==1 for i in range(len(t))):
    print("Yes")
else:
    print("No")

import sys
s = input()
t = input()

for i in range(len(s)):
    if s == t:
        print("Yes")
        sys.exit()
    else:
        tmp = s[0]
        s = s[1:] + tmp
print("No")

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
S = input()
T = input()

ans =""
for i in reversed(S):
    ans += i

if ans == T:
    print("Yes")
else:
    print("No")

S = input()
T = input()
i = 0
while True:
    S = S[-1:]+S[:-1]
    if S == T:
        print("Yes")
        break
    else:
        i += 1
    if i == len(S):
        print("No")
        break

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):

def count_diff(a,b):
    
    cnt = 0
    for c in a:
        if not(c in b):
            return False
    for c in b:
        if not(c in a):
            return False
    return True

def main():
    S = str(input())
    T = str(input())

    if(S==T):
        print('Yes')
        return
    if(count_diff(S,T)):
        print('No')
        return
    
    
    length_S = len(S)
    ch_S = S
    for i in range(length_S):
        ch_S = ch_S[length_S-1] + ch_S[0:length_S-1]
        if(ch_S == T):
            print('Yes')
            return
    print('No')



if __name__ == "__main__":
    main()


def count_diff(a,b):
    
    cnt = 0
    for c in a:
        if not(c in b):
            cnt += 1
    return cnt

def main():
    S = str(input())
    T = str(input())

    if(S==T):
        print('Yes')
        return
    count = count_diff(S,T)
    if(count > 0):
        print('No')
    
    
    length_S = len(S)
    ch_S = S
    for i in range(length_S):
        ch_S = ch_S[length_S-1] + ch_S[0:length_S-1]
        print(ch_S)
        if(ch_S == T):
            print('Yes')
            return
    print('No')



if __name__ == "__main__":
    main()


def count_diff(a,b):
    
    cnt = 0
    for c in a:
        if not(c in b):
            return True
    for c in b:
        if not(c in a):
            return True
    return False

def main():
    S = str(input())
    T = str(input())

    if(S==T):
        print('Yes')
        return
    if(count_diff(S,T)):
        print('No')
        return
    
    
    length_S = len(S)
    ch_S = S
    for i in range(length_S):
        ch_S = ch_S[length_S-1] + ch_S[0:length_S-1]
        if(ch_S == T):
            print('Yes')
            return
    print('No')



if __name__ == "__main__":
    main()

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s=input()
t=input()
for i in range(0,len(s)):
  if s[i:i]+s[i:] == t:
    print('Yes')
    exit()
print('No')

s=input()
t=input()
for i in range(0,len(s)):
  if s[i:]+s[0:i] == t:
    print('Yes')
    exit()
print('No')

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
from collections import deque
s = input()
t = input()

u = deque(s)
ok = False
for i in range(len(s)):
  u.rotate()
  if str(u) == t:
    ok = True
    
print('Yes' if ok else 'No')

from collections import deque
s = input()
t = input()

u = deque(s)
ok = False
for i in range(len(s)):
  u.rotate(1)
  if ''.join(u) == t:
    ok = True
    
print('Yes' if ok else 'No')

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
s = input()
t = input()
c = 1
for i in range(len(s)):
  s = s[-1] + s[:-1]
  if s = t:
    c = 0
print('YNeos'[c::2])

s = input()
t = input()
c = 1
for i in range(len(s)):
  s = s[-1] + s[:-1]
  if s == t:
    c = 0
print('YNeos'[c::2])

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
import sys
s = str(input())
t = str(input())
for i in range(len(s)):
    s = s[-1] + s[:len(s)-1]
    print(s)
    if s == t:
        sys.exit()
print('No')

import sys
s = str(input())
t = str(input())
for i in range(len(s)):
    s = s[-1] + s[:len(s)-1]
    print(s)
    if s == t:
        print('Yes')
        sys.exit()
print('No')

import sys
s = str(input())
t = str(input())
for i in range(len(s)):
    s = s[-1] + s[:len(s)-1]
    if s == t:
        print('Yes')
        sys.exit()
print('No')

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
S = input()
T = input()
ans = "NO" 
for i in range(len(S)):
  s = S[i:] + S[:i]
  if s == T:
    ans = "YES"
print(ans)

S = input()
T = input()
ans = "No" 
for i in range(len(S)):
  s = S[i:] + S[:i]
  if s == T:
    ans = "Yes"
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a=input()
b=input()
printf('Yes' if a in (b*2) else 'No')

a=input()
b=input()
print('Yes' if a in (b*2) else 'No')

Verdicts: Runtime Error

Accepted