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):
s, t = map(str, input().split())
x = len(s)
n = 0
if s == t:
    n = 1
else:
    for i in range(x):
        s = s[-1] + s[:-1]
        if s == t:
            n = 1

if n == 0:
    print('No')
else:
    print('Yes')

s = input()
t = input()
x = len(s)
n = 0
if s == t:
    n = 1
else:
    for i in range(x):
        s = s[-1] + s[:-1]
        if s == t:
            n = 1
 
if n == 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):
import sys

s = input()
t = input()

sLen = len(s)

for i in range(sLen):
    sRote = s[1:sLen] + s[0]
    s = sRote
    print(s)
    if s == t :
        #print("Yes")
        sys.exit()

print("No")

import sys

s = input()
t = input()

sLen = len(s)

for i in range(sLen):
    sRote = s[1:sLen] + s[0]
    s = sRote
    #print(s)
    if s == t :
        print("Yes")
        sys.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,T = map(str,input().split())
ans = False
for i in range(len(S)):
    if list(S) == [list(T)[(i+j)%(len(T))] for j in range(len(T))]:
        ans = True
if ans:
    print('Yes')
if not ans:
    print('No')

S = input()
T = input()
ans = False
for i in range(len(S)):
    if list(S) == [list(T)[(i+j)%(len(T))] for j in range(len(T))]:
        ans = True
if ans:
    print('Yes')
if not ans:
    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 itertools as it
import collections as col

import sys
sys.setrecursionlimit(10000)

def main():
    s = input()
    t = input()
    
    print(s in 2*t)

if __name__ == '__main__':
    main()

import itertools as it
import collections as col

import sys
sys.setrecursionlimit(10000)

def main():
    s = input()
    t = input()
    
    print('Yes' if s in 2*t else 'No')

if __name__ == '__main__':
    main()

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())
k=0
for i in range(len(t)):
    if s[i]==t[i]:        
        print('Yes')
        exit()
    elif k=len(t):print('No')
    else:
      s.insert(0,s.pop(-1))
      k+=1

s=input()
t=input()
for i in range(len(s)):
    if s[i:len(s)]+s[:i]==t:
        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):
import collections deque
S=deque(input())
T=deque(input())
for i in range(len(T)):
  if S==T:
    print("Yes")
    exit()
  t=T.popleft()
  T.appendleft(t)
print("No")

print("Yes" if input() in input()*2 else "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):
def main():
        run()

def run():
        word = input()
        word = list(word)
        target = input()
        isSame = False
        for _ in range(len(word)):
                word_string = "".join(word)
                print(word_string)
                if word_string == target:
                        isSame = True
                        break
                rotate_char = word.pop(0)
                word.append(rotate_char)
        if isSame:
                print("Yes")
        else:
                print("No")

if __name__ == "__main__":
        main()

def main():
        run()

def run():
        word = input()
        word = list(word)
        target = input()
        isSame = False
        for _ in range(len(word)):
                word_string = "".join(word)
                if word_string == target:
                        isSame = True
                        break
                rotate_char = word.pop(0)
                word.append(rotate_char)
        if isSame:
                print("Yes")
        else:
                print("No")

if __name__ == "__main__":
        main()

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]==T[0]:
        new_s=S[i:]+S[:i]
         if new_s==T:
             print("Yes")
             exit()

print("No")

S=input()
T=input()
for i in range(len(S)):
    if S[i]==T[0]:
        new_s=S[i:]+S[:i]
         if new_s==T:
             print("Yes")
             exit()

print("No")

S = input()
T = input()
for i in range(len(S)):
    if S[i] == T[0]:
        new_s = S[i:] + S[:i]
        if new_s == T:
            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()
N = ""
flg = False
for i in range(len(S)):
    N = S[i:]+S[:i]
    print(N)
    if N == T:
        flg = True
if flg:
  print("Yes")
else:
  print("No")

S = input()
T = input()
N = ""
flg = False
for i in range(len(S)):
    N = S[i:]+S[:i]
    if N == T:
        flg = True
if flg:
  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()
def_list = list()
for i in range(len(s)):
    if s[i] == t[i]:
        def_list.append(s[i])
if len(def_list)%2 == 0:
    print("Yes")
else:
    print("No")

s = input()
t = input()
if t in s*2:
    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()
a=0
while(s!=t):
	s =s[-1]+s[:-1]
	a+=1
    if a==len(s):
    	print("NO")
        break
if s==t:
	print("YES")
        

s=input()
t=input()
a=0
while(s!=t):
	s =s[-1]+s[:-1]
	a+=1
	if a==len(s):
		print("NO")
		break
if s==t:
	print("YES")

s=input()
t=input()
a=0
while(s!=t):
	s =s[-1]+s[:-1]
	a+=1
	if a==len(s):
		print("NO")
		break
if s==t:
	print("YES")

s = input(); t = input()
c = 0 
     
while (s != t):
	s = s[-1] + s[:-1]
	c += 1
	if c == len(s):
		print('No')
		break
        
if s == t:
	print('Yes')

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, t = [input() for i in range(2)]
for _ in range(len(s)):
  s = s[1:] + s[0]
  if s = t:
    print("Yes") 
    break
else:
  print("No")

s, t = [input() for i in range(2)]
for _ in range(len(s)):
  s = s[-1] + s[:-1]
  if s == t:
    print("Yes") 
    break
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()
ss = s+s+s
f=0
for i in range(len(s)):
    if ss[i:len(s)+i] == t:
    f = 1
if f:
    print("Yes")
else:
    print("No")


s = input()
t = input()
ss = s+s
f=0
for i in range(len(s)):
    if ss[i:len(s)+i] == t:
    f = 1
if f:
    print("Yes")
else:
    print("No")


s = input()
t = input()
ss = s+s
f=0
for i in range(len(s)):
    if ss[i:len(s)+i] == t:
        f = 1
if f:
    print("Yes")
else:
    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()
s *= 2
if t in s:
    print("No")
else:
    print("Yes")

s = input()
t = input()
s *= 2
if t in s:
    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()
l = len(S)
ok = 1
for i in range(l):
   T = T[l-1]+T[0:l-1]
   print(T)
   if S==T:
      print("Yes")
      break
   elif l-1==i:
      print("No")
      break

S = input()
T = input()
l = len(S)
ok = 1
for i in range(l):
   T = T[l-1]+T[0:l-1]
   if S==T:
      print("Yes")
      break
   elif l-1==i:
      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):
import sys
input = sys.stdin.readline
S = list(input())
T = list(input())
del S[-1]
del T[-1]
l = len(S)
ans = "No"
for i in range(l) :
    a = S[-1]
    del (S[-1])
    S.insert(0,a)
    print(S)
    if S == T :
        ans = "Yes"
        break
print(ans)


#template
def inputlist(): return [int(k) for k in input().split()]
#template
S = list(input())
T = list(input())
for i in range(len(S)):
    Sa = S[:]
    S = [Sa[-1]] + Sa[:-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

S = input()
T = input()


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


print("No")

import sys

S = input()
T = input()


for i in range(len(S)):
    if S==T:
        print("Yes")
        sys.exit()
    S = S[len(S)-1]+S[0: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()

def match(a, b):
    for i in range(len(a)):
        if a[i:] + a[:i] == b:
            return True

    return False

if match(s, t):
    print("yes")
else:
    print("no")



s = input()
t = input()

def match(a, b):
    for i in range(len(a)):
        if a[i:] + a[:i] == b:
            return True

    return False

if match(s, 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=list(input())
t=list(input())

x=len(s)

ch1=0
ch=0

for i in range(x):
  if s[i]==t[x-1-i]:
    ch+=1

for j in range(x):
  if s[j]==t[j]:
    ch1+=1
    
print('Yes') if ch==x or ch1==x else print('No') 



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

x=len(s)

ch1=0
ch=0

for i in range(x):
  if s[i]=t[x-1-i]:
    ch+=1

for j in range(x):
  if s[j]=t[j]:
    ch1+=1
    
print('Yes' if ch==x or ch1==x else:'No')
  

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

x=len(s)

ch1=0
ch=0

for i in range(x):
  if s[i]=t[x-1-i]:
    ch+=1

for j in range(x):
  if s[j]=t[j]:
    ch1+=1
    
print('Yes') if ch==x or ch1==x else print('No') 


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

x=len(s)

ch1=0
ch=0

for i in range(x):
  if s[i]=t[x-1-i]:
    ch+=1

for j in range(x):
  if s[j]=t[j]:
    ch1+=1
    
print('Yes' if ch==x or ch1==x :'No' else)
  


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

x=len(s)

ch1=0
ch=0

for i in range(x):
  if s[i]=t[x-1-i]:
    ch+=1

for j in range(x):
  if s[j]=t[j]:
    ch1+=1
    
print('Yes' if ch==x or ch1==x else 'No' )
  


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

S=s+s
c=0

for i in range(len(s)):
  ch=0
  for j in range(len(s)):
    if S[i+j]==t[j]:
      ch+=1
  if ch==len(s):
    c+=1

if c>0:
  print('Yes')
  
else:
  print('No')



Verdicts: Wrong Answer

Runtime Error

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):
a=list(input())
s=list(input())
b=False
for i in range(len(s)):
  d=a[0]
  del a[0]
  a.append(d)
  if a==s:
    print("Yes")
    break
if b==False:
  print("No")

a=list(input())
s=list(input())
b=False
for i in range(len(s)):
  d=a[-1]
  del a[-1]
  a1=a[::-1]
  a1.append(s)
  a2=a1[::-1]
  if a2==s:
    b=True
    print("Yes")
    break
  else:
    pass
if b==False:
  print("No")
  
  
  

a=list(input())
s=list(input())
b=False
for i in range(len(s)):
  d=a[0]
  del a[0]
  a.append(d)
  if a==s:
    print("Yes")
    b=True
    break
if b==False:
  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):
a = list(input()).sorted()
b = list(input()).sorted()
if a == b:
  print("Yes")
else:
  print("No")

s = input()
t = input()
for i in range(len(s)):
  if s == t:
    print("Yes")
    break
  else:
    t = t[-1] + t[:-1]
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):
aaaaaaaaaaaaaaab
aaaaaaaaaaaaaaab

import sys

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

for i in range(len(s)):    
    if s == t:
        break

    tmp = s.pop(len(s)-1)
    s.insert(0, tmp)

if s == t:
    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):
a = input()
b = input()

counter = {}
for c in a:
    if not c in counter:
        counter[c] = 1
    else:
        counter[c] += 1
counter_2 = {}
for c in a:
    if not c in counter_2:
        counter_2[c] = 1
    else:
        counter_2[c] += 1
if conter == counter_2:
    print(True)
else:
    print(False)

a = input()
b = input()
for i in range(len(list(a))):
    if a[i] not in b:
        print("Yes")
    else:
        print("No")

s = input()
t = input()
c = list(s)
d = list(t)
for i in range(len(c)):
    c.insert(0, c[-1])
    del c[-1]
    if c == d:
        print("Yes")
        break
    if i == len(c) -1:
        print("No")

Verdicts: Runtime Error

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.sort()==T.sort():
	print("Yes")
else:
	print("No")

S=input()
T=input()
for i in range(len(S)):
	S=S[-1]+S[0:-1]
	if S==T:
		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(inpiut())
T = str(input())

S = S+S
if T in S:
  print('Yes')
else:
  print('No')

S = str(input())
T = str(input())
 
S = S+S
if T in S:
  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()
ls = ls2 = 0


s = list(s)
for i in s:
    ls += t.count(i)
    ls2 += s.count(i)


print(ls)
print(ls2)
if ls == ls2:
    print('Yes')
else:
    print('No')

s = input()
t = input()
print("Yes") if t in s*2 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())
flag=0
for a in range(len(s)+3):
    t.append(t.pop(0))
    if s==t:
        print("Yes")
        flag=1
if flag==0:
    print("No")

s=list(input())
    t=list(input())
    flag=0
    for a in range(len(s)):
        t.append(t.pop(0))
        if s==t:
            print("Yes")
            flag=1
    if flag==0:
        print("No")

s=list(input())
t=list(input())
flag=0
for a in range(len(s)+2):
    if s==t:
        print("Yes")
        flag=1
        break
    t.append(t.pop(0))
if flag==0:
    print("No")

Verdicts: 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()

if S[::-1] == T:
    print('Yes')
else:
    print('No')



S = input()
T = input()

for i in range(len(S)):
    last = S[-1]
    S = last + S[:-1]
    if S == T:
        print('Yes')
        break
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()
import sys
if s==t:
    print("Yes")
    sys.exit()
for i in range(1,len(s)):
    print(s[-i:]+s[:-i])
    if s[-i:]+s[:-i]==t:
        print("Yes")
        #sys.exit()
else:
    print("No")

s = input()
t = input()
import sys
if s==t:
    print("Yes")
    sys.exit()
for i in range(1,len(s)):
    if s[-i:]+s[:-i]==t:
        print("Yes")
        sys.exit()
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()
org = T
for i in T:
    T = T[1:] + T[0]
    if T == S:
        print('Yes')
    elif T == org:
        print('No')

S = list(input())
T = list(input())
ans = S
if S == T:
    print('Yes')
    exit()
for i in range(len(S)):
    Stmp1 = ans[-1]
    Stmp2 = "".join(ans[:-1])
    ans = Stmp1+Stmp2
    if ans == T:
        print('Yes')
        exit()

print('No')

S = list(input())
T = list(input())
ans = S
for i in range(len(S)):
    Stmp1 = ans[-1]
    Stmp2 = "".join(ans[:-1])
    ans = Stmp1+Stmp2
    if ans == T:
        print('Yes')
        exit()

print('No')

S = input()
T = input()
org = T
if S == T:
    print('Yes')
    exit()
    
for i in T:
    T = T[1:] + T[0]
    if T == S:
        print('Yes')
        exit()
    elif T == org:
        print('No')
        exit()


Verdicts: 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 i in range(S):
    S = S[-1] + S[:-1]
    if S == T:
        print('Yes')
        exit()
print('No')

S = input()
T = input()
for i in range(len(S)):
    S = S[-1] + S[:-1]
    if S == T:
        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):
import numpy

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

if set(s) != set(t):
    print('No')

tmp = s[:]
for i in range(len(tmp)):
    tmp = numpy.roll(tmp, 1)
    if ''.join(tmp) == t:
        print('YES')
        break

import numpy

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

tmp = s[:]
for i in range(len(tmp)):
    tmp = numpy.roll(tmp, 1)
    if ''.join(tmp) == 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):
# -*- coding: utf-8 -*-

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

ans = False

for i in range(len(s)):
    print(s)
    if s == t:
        ans = True
        break
    temp = s[0]
    for j in range(1,len(s)):
        s[j-1] = s[j]
    s[-1] = temp

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



# -*- coding: utf-8 -*-

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

ans = False

for i in range(len(s)):
    if s == t:
        ans = True
        break
    temp = s[0]
    for j in range(1,len(s)):
        s[j-1] = s[j]
    s[-1] = temp

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 = input()
T = input()

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

S = input()
T = input()

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

S = input()
T = input()

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

Verdicts: 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()
t2 = t[-1] + t[:-1]
while t2 != t:
  if s == t2:
    print("yes")
    exit()
  t2 = t2[-1] + t2[:-1]
print("no")

import copy
s = input()
t = input()
t2 = t[-1] + t[1:]
while t2 != t:
  if s = t2:
    print("yes")
    return 0
  t2 = t[-1] + t[1:]
print("no")

s = input()
t = input()
t2 = t[-1] + t[1:]
while t2 != t:
  if s == t2:
    print("yes")
    return 0
  t2 = t[-1] + t[1:]
print("no")

s = input()
t = input()
t2 = t[-1] + t[:-1]
while t2 != t:
  if s == t2:
    print("yes")
    exit()
  t2 = t2[-1] + t2[:-1]
print("no")


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

Verdicts: Wrong Answer

Runtime Error

Runtime Error

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)):
    x = T[0]
    T = T[1:]
    T = T + x
    print(T)
    print(S)
    if T == S:
        flag = True
        break
    
if flag:
    print("Yes")
else:
    print("No")

S = input()
T = input()

flag = False
for i in range(len(S)):
    x = T[0]
    T = T[1:]
    T = T + x
    if T == S:
        flag = True
        break
    
if flag:
    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())

if len(s)!=len(t):
      print("No")
      exit()
elif s==t:
      print("Yes")
      exit()

for i in range(len(s)):
      if s.append(s.pop(0))==t:
            print("Yes")
            exit()
print("No")
      

s=input()
t=input()

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


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

for i in range(len(s)):
      s.insert(0,s.pop())
      if ''.join(s)==''.join(t):
            print('Yes')
            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):
a=input()
b=input()
for i in range(len(a)):
    if a==b:
        print("Yes")
        break
    
    a=a[-1]+a
    a=a[:len(a)-1]
else:
    print("No"

a=input()
b=input()
for i in range(len(a)):
    if a==b:
        print("Yes")
        break
    
    a=a[-1]+a
    a=a[:len(a)-1]
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):
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    l = list(map(int, lines.pop(0).split(' ')))
    l.sort()
    print(l[2] - l[0])

#
# main
#

# 1. use list instead of stdin
# 2. use stdin

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    S = lines.pop(0)
    T = lines.pop(0)
    for i in range(len(S)):
        S = S[-1] + S[:-1]
        if S == T:
            print('Yes')
            sys.exit(0)

    print('No')

#
# main
#

# 1. use list instead of stdin

#contents = '''\
#abcdefg

#'''


# 2. use stdin

lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

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):
ANS='No'
S=input()
T=input()
N=len(S)
for i in range(S):
  if S[i:N] + S[:i] == T:
    ANS='Yes'
    break
print(ANS)

ANS='No'
S=input()
T=input()
N=len(S)
for i in range(N):
  if S[i:N] + S[: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()
s=list(S)
T=input()
t=list(T)
for i in range(len(s)):
  s.insert(0,s[-1])
  print(s)
  s.pop(-1)
  
  print(s)
  if s==t:
    print('Yes')
    exit()
  
print('N

S=input()
s=list(S)
T=input()
t=list(T)
for i in range(len(s)):
  s.insert(0,s[-1])
  print(s)
  s.pop(-1)
  
  print(s)
  if s==t:
    print('Yes')
    exit()
  
print('No')

S=input()
s=list(S)
T=input()
t=list(T)
for i in range(len(s)):
  s.insert(0,s[-1])
  s.pop(-1)
  if s==t:
    print('Yes')
    exit()
  
print('No')

Verdicts: Runtime Error

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()
a=0
f=False

for i in range(len(s)):
	a=s[-1]
	s=s[:-1]
	s=a+s
	
	if s==t:
		f=True
		break
		
if f:
	print('Yes')
else:
	print('No')

s=input()
t=input()
a=0
f=False

for i in range(len(s)):
	a=s[-1]
	s=s[:-1]
	s=a+s
	
	if s==t:
		f=True
		break
		
if f:
	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):
N = int(input())
print('Yes' if 9 in N else 'No')

print("Yes" if input() in input()*2 else "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(len(s)):
  if s != t[i:]+t[:i]:
    j=0 
    
  else:
    j=1
    break

if j==1:
  print("yes")
else:
  print("no")

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

for i in range(len(S)):
  if S == T[i:]+T[:i]:
    j = 1
    break
  else:
    j = 0

if j == 1:
  print("yes")
else:
  print("no")

s = input()
t = input()
 
for i in range(len(s)):
  if s[i:]+s[:i] != t:
    j=0 
  else:
    j=1
    break

if j==1:
  print("yes")
else:
  print("no")

import sys

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

for i in range(len(S)):
  if S == (T[i:]+T[0:i]):
    print("yes")
    sys.exit()
    
print("no")

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

for i in range(len(S)):
  if S == T[i:]+T[:i]:
    j = 1
    break
  else:
    j = 0

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

Verdicts: 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):
aaaaaaaaaaaaaaab
aaaaaaaaaaaaaaab

n=input()
m=input()
n*=2
if m in n:
    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()
for i in range(1,len(S)):
    if S[-i:]+S[:-i]==T:
        print('Yes')
        exit
print('No')

S=input()
T=input()
for i in range(0,len(S)):
    if S[-i:]+S[:-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):
print("Yes" for input() in input()*2 else "No")  

print("Yes" if input() in input()*2 else "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(100):
    a = 0
    s = s[-1:] + s[:-1]
    if s == t:
        a += 1
if a == 1:
    print("Yes")
else:
    print("No")

s=[input()]
t=[input()]
s.sort()
t.sort()
if s == t:  
    print("Yes")
else:
    print("No")

vs=input()
t=input()
print("Yes" if t in s*2 else "No")

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

Verdicts: Wrong Answer

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 = list(input())

if S[0] != 'A':
    print('WA')
elif S[2:-1].count('C') != 1:
    print('WA')
else:
    S = list(S[1:])
    S.remove('C')
    S = ''.join(S)
    if S.islower():
        print('AC')
    else:
        print('WA')


from collections import deque

S = deque(input())
T = deque(input())

for _ in range(len(S)):
    if S == T:
        print('Yes')
        break
else:
    print('No')




from collections import deque

S = deque(input())
T = deque(input())

for _ in range(len(S)):
    if S == T:
        print('Yes')
        break
    S.rotate()
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):
Ss=input()
Ts=input()
s=[_ for _ in Ss]
t=[_ for _ in Ts]
l=len(Ss)
for i in range(l):
  temp=s[l-1]
  for j in range(l-1,-1,-1):
    s[j]=s[j-1]
  else:
    s[0]=temp
  print(s)
  if s==t:
    res='Yes'
    break
else:
  res='No'
print(res)

Ss=input()
Ts=input()
s=[_ for _ in Ss]
t=[_ for _ in Ts]
l=len(Ss)
for i in range(l):
  temp=s[l-1]
  for j in range(l-1,-1,-1):
    s[j]=s[j-1]
  else:
    s[0]=temp
  if s==t:
    res='Yes'
    break
else:
  res='No'
print(res)


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
input = sys.stdin.readline
S = list(input())
T = list(input())
N = len(S)
for i in range(N):
    S = S[-1] + S[:N-1]
    if S == T:
        print("Yes")
        sys.exit()
print("No")

import sys
input = sys.stdin.readline
S = list(input().rstrip())
T = list(input().rstrip())
N = len(S)
for i in range(N):
    S = list(S[-1]) + S[:N-1]
    if S == T:
        print("Yes")
        sys.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):
def main():
    s = list(input())
    t = list(input())
    print(t)
    print(s)
    s_len = len(s)
    for i in range(s_len):
        if s == t:
            return
        tmp = s[0]
        s.pop(0)
        s.append(tmp)
    print(t)
    print(s)


main()


def main():
    s = list(input())
    t = list(input())
    s_len = len(s)
    for i in range(s_len):
        if s == t:
            print("Yes")
            return
        tmp = s[0]
        s.pop(0)
        s.append(tmp)
    print("No")


main()


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 solve(s,t):
    if(s == t):
        return "Yes"
    for i in range(len(s)-1,0,-1):
        f = s[i:] + s[:i]
        print(f)
        if(f == t):
            return "Yes"
    return "No"

s = input()
t = input()
print(solve(s,t))

def solve(s,t):
    if(s == t):
        return "Yes"
    for i in range(len(s)-1,0,-1):
        f = s[i:] + s[:i]
        if(f == t):
            return "Yes"
    return "No"

s = input()
t = input()
print(solve(s,t))

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,T = map(str,input().split())
for i in range(len(S)):
  tmp = S[-1]
  S[-1] = ""
  S.insert(0,tmp)
  if S == T:
    print("Yes")
    sys.exit()
print("No")
    

import sys
S = input()
T = input()
for i in range(len(S)):
  tmp = S[-1]
  S = tmp + S[:-1]
  if S == T:
    print("Yes")
    sys.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 = input()
T = input()
A = S
if S == T:
  print('Yes')
else:
  eq = False:
  for i in range(len(S)):
    A = A[-1] + A[0:-1]
    if A == T:
      eq = True
      break
  if eq:
    print('Yes')
  else:
    print('No')
  

S = input()
T = input()
A = S
if S == T:
  print('Yes')
else:
  eq = False
  for i in range(len(S)):
    A = A[-1] + A[0:-1]
    if A == T:
      eq = True
      break
  if eq:
    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 = input()
t = input()
for i in len(s):
  ok = 1
  for j in len(s):
    if s[(i+j)%len(s)] != t[j]:
      ok = 0
  if ok == 1:
    print("Yes")
    sys.exit()
print("No")
    

import sys
s = input()
t = input()
for i in range(len(s)):
  ok = 1
  for j in range(len(s)):
    if s[(i+j)%len(s)] != t[j]:
      ok = 0
  if ok == 1:
    print("Yes")
    sys.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 = input()
T = input()

lengt = len(S)
lst = []

for i in range(length):
    lst.append(S[i: length]+S[0: i])
    
if T in lst:
    print('Yes')
else:
    print('No')

S = input()
T = input()

length = len(S)
lst = []

for i in range(length):
    lst.append(S[i: length]+S[0: i])
    
if T in lst:
    print('Yes')
else:
    print('No')

Verdicts: Runtime Error

Accepted