TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
a, b, c = sorted(map(int, input().split()))
print(a - c + b - c)



a, b, c = sorted(map(int, input().split()), reverse=True)
print(a - c + b - c)


a, b, c = sorted(map(int, input().split()), reverse=True)
print(a - c)


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
l = list(map(int,input().split()))
l.sort()
ans = []
for i in range(N-1):
  ans.append(l[i+1] - l[i])
print(sum(ans))

l = list(map(int,input().split()))
l.sort()
ans = []
for i in range(len(l)-1):
  ans.append(l[i+1] - l[i])
print(sum(ans))

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
a_list=list(int,input().split())
ans=abs(a[0]-a[1])+abs(a[0]-a[2])
ans=min(ans,abs(a[1]-a[0])+abs(a[1]-a[2]))
ans=min(ans,abs(a[2]-a[1])+abs(a[0]-a[2]))
print(ans)

a_list=list(map(int,input().split()))
ans=abs(a[0]-a[1])+abs(a[0]-a[2])
ans=min(ans,abs(a[1]-a[0])+abs(a[1]-a[2]))
ans=min(ans,abs(a[2]-a[1])+abs(a[0]-a[2]))
print(ans)

a=list(map(int,input().split()))
ans=abs(a[0]-a[1])+abs(a[0]-a[2])
ans=min(ans,abs(a[1]-a[0])+abs(a[1]-a[2]))
ans=min(ans,abs(a[2]-a[1])+abs(a[0]-a[2]))
print(ans)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
# -*- coding: utf-8 -*-
a,b,c = map(int,input().split())
print("{}".format(min(abs(a-b),abs(b-c),abs(c-a)))) 

A = list(map(int,input().split()))
A.sort()
print(abs(A[2]-A[1])+abs(A[1]-A[0]))

Verdicts: Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
a,b,c = map(int,input())
print(c-a)

a,b,c = sorted(map(int,input().split()))
print(c-a)

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
a = map(int,input().split())
Min = min(a)
Max = max(a)
Mid = sum(a) - Max - Min

ans = Mid-Min + Max-Mid
print(ans)

a = list(map(int,input().split()))
Min = min(a)
Max = max(a)
Mid = sum(a) - Max - Min
 
ans = Mid-Min + Max-Mid
print(ans)

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
A = list(map(int,input().split))
A.sort()
print(A[2]-A[0])

A = list(map(int,input().split))
A.sort
print(A[2]-A[0])

A = list(map(int,input().split()))
A.sort()
print(A[2]-A[0])

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
a = map(int, input().split())
print(max(a)-min(a))

a = list(map(int, input().split()))
print(max(a)-min(a))

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
s = input()
t = input()
ans=0
for i in range(0,len(s)):
    a=s[i:]
    b=s[:i]
    ss=a+b
    print(ss)
    if ss == t:
        ans = 1
if ans == 1:
    print("Yes")
else:
    print("No")

li = list(map(int,input().split()))
li.sort()
#li
li[2]-li[1]+li[1]-li[0]

li = list(map(int,input().split()))
li.sort()
#li
print(li[2]-li[1]+li[1]-li[0])

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
a = input().split()

a.sort()

print(a[-1] - a[0])

a = input().split()
b =[]
for i in a:
    b.append(int(i))
b.sort()

print(b[-1] - b[0])

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
N, M = list(map(int, input().split(' ')))
edges = []
for i in range(M):
    a, b = list(map(int, input().split(' ')))
    edges.append([v for v in range(a, b)])

ans = 0
while any(edges):
    hit_index = 0
    max_hit = 0
    edge = []
    for i in range(len(edges)):
        if edges[i]:
            edge = edges[i]
            break
    for v in edge[::-1]:
        hit = 0
        for i in range(M):
            if edges[i] and v in edges[i]:
                hit += 1
            if hit > max_hit:
                max_hit = hit
                hit_index = v
    # print('max_hit')
    # print(max_hit)
    # print('cut here')
    # print(hit_index)
    for i in range(len(edges)):
        if edges[i] and hit_index in edges[i]:
            edges[i] = False
    ans += 1
    # print('cutted')
    # print(edges)
print(ans)


nums = sorted(list(map(int, input().split(' '))))
print(sum([abs(nums[i+1] - nums[i]) for i in range(len(nums) - 1)]))

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
l= list(map(int, input()))
l.sort()
print(l[2] - l[1])


l= list(map(int, input().split()))
l.sort()
print(l[2] - l[0])

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
S=input()
T=input()
T_0_equal=[]
for i in range(len(S)):
  if(T[0]==S[i]):
    T_0_equal.append(i)
#print(T_0_equal)
for i in range(len(T_0_equal)):
  count=0
  for j in range(len(S)):
    if(T[j]!=S[(j+T_0_equal[i])%len(S)]):
      break
    else:
      count+=1
  if(count==len(S)):
  	print('Yes')
  	exit()
print('No')  

l=sorted(list(map(int,input().split())))
print(max(l)-min(l))

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
A = list(map(int, input().split()))
ans = min(A)
for a in sorted(A):
    ans = abs(ans-a)
print(ans)

from itertools import permutations
A = list(map(int, input().split()))
ans = float('inf')
for p in permutations(A):
    ans = min(ans, abs(p[0]-p[1])+abs(p[1]-p[2]))
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
a,b,c=map(int,input().split())
print(c-a)


a,b,c=map(int,input().split())
print(max(a,b,c)-min(a,b,c))

Verdicts: Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
x,y,z = sorted(map(int, input().split()))
print((b-a)+(c-b))

x,y,z = sorted(map(int, input().split()))
print((y-x)+(z-y))

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
a, b, c = map(int, input().split())
k = max(a, b, c)
l = min(a, b, c)

print(int(k - l)

a,b,c=sorted(map(int,input().split()));print(c-a)

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
a=map(int,input().split())
a.sort()
print(min((abs(a[0]-a[1])+abs(a[1]-a[2])),(abs(a[2]-a[1])+abs(a[1]-a[0]))))

a=list(map(int,input().split()))
a.sort()
print(min((abs(a[0]-a[1])+abs(a[1]-a[2])),(abs(a[2]-a[1])+abs(a[1]-a[0]))))

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
a =list(map(int, input().split()))
a.sort
print(a[2]-a[0])

a =list(map(int, input().split()))
a.sort()
print(a[2]-a[0])

Verdicts: Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
task = input()
task = task.split()
costs = []
for i in range(len(task)):
    costs.append(int(task[i]))
task.sort()
cost = 0
for i in range(len(costs)-1):
    cost += costs[i+1]-costs[i]
    
print(cost)

task = input()
task = task.split()
costs = []
for i in range(len(task)):
    costs.append(int(task[i]))
costs.sort()
cost = 0
for i in range(len(costs)-1):
    cost += costs[i+1]-costs[i]
    
print(cost)


Verdicts: Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
data = lists(map(int, input().split()))
print (max(data) - min(data))

data = list(map(int, input().split()))
print (max(data) - min(data))

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
def main(a: list):
    a = sorted(a)

    cost = 0

    cost += abs(a[0] - a[1])
    print(cost)
    cost += abs(a[1] - a[2])
    print(cost)

    return cost


if __name__ == '__main__':
    print(main(list(map(int, input().split(' ')))))


def main(a: list):
    a = sorted(a)

    cost = 0

    cost += abs(a[0] - a[1])
    cost += abs(a[1] - a[2])

    return cost


if __name__ == '__main__':
    print(main(list(map(int, input().split(' ')))))


Verdicts: Wrong Answer

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
A=int(input())
A.sort()
print(A[2]-A[0])

A=list(map(int,input().split()))
print(max(A)-min(A))

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
*a = map(int,input.split())
print(max(a) - min(a))


*a = map(int,input().split())
print(max(a) - min(a))


*a, = map(int,input().split())
print(max(a) - min(a))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
n = input()
n.sort()
print(int(n[2])-int(n[0]))

n = list(input())
n.sort()
print(int(n[2])-int(n[0]))

n = list(map(input().split()))
n.sort()
print(int(n[2])-int(n[0]))

n = list(map(int,input().split()))
n.sort()
print(n[2]-n[0])

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
A=sorted(list(map(int,input.split())))
print(A[2]-A[0])

A=sorted(list(map(int,input.split())))
print(A[2]-A[0]+1)

A=sorted(list(map(int,input().split())))
print(A[2]-A[0])

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

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

cur = T.find(S[0])
i = 0
con = len(S)

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



A = list(map(int,input().split()))

ans = (max(A) - min(A))

print(ans)

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
def LI():
	return [ int(s) for s in input().split() ]

A = LI()

A12 = abs(A[0]-A[1])
A23 = abs(A[1]-A[2])
A31 = abs(A[3]-A[1])

print(min(A12+A23,A23+A31,A31+A12))



def LI():
	return [ int(s) for s in input().split() ]
 
A = LI()
 
A12 = abs(A[0]-A[1])
A23 = abs(A[1]-A[2])
A31 = abs(A[2]-A[0])
 
print(min(A12+A23,A23+A31,A31+A12))

Verdicts: Runtime Error

Accepted
Problem: You have three tasks, all of which need to be completed.  First, you can complete any one task at cost 0.  Then, just after completing the i-th task, you can complete the j-th task at cost |A_j - A_i|.  Here, |x| denotes the absolute value of x.  Find the minimum total cost required to complete all the task.

Submission attempts (in order):
A = [map(int, input().split())]

print(max(A) - min(A))


A = [int(x) for x in input().split()]

print(max(A) - min(A))


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():
    x = input()
    y = input()

    l = []
    for i in range(len(x)):
        s = x[-i - 1:] + x[:-i - 1]
        l.append(s)

    if y in l:
        print("Yes")
    else:
        print("No")


def main2():
    x = input()
    y = input()
    ans = False

    s = x
    for i in range(len(x)):
        if s == y:
            ans = True
            break
        s = s[-1] + s[:-1]

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


if __name__ == '__main__':
    pass


def main():
    x = input()
    y = input()

    l = []
    for i in range(len(x)):
        s = x[-i - 1:] + x[:-i - 1]
        l.append(s)

    if y in l:
        print("Yes")
    else:
        print("No")


def main2():
    x = input()
    y = input()
    ans = False

    s = x
    for i in range(len(x)):
        if s == y:
            ans = True
            break
        s = s[-1] + s[:-1]

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


if __name__ == '__main__':
    main2()


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


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

S = input()
T = input()

ans = False
for i in range(len(S)):
    if S == T:
        ans = True
        break
    S = S[1:] + S[0: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 = input()
T = input()
for i in range(len(S)):
  U = S[-i: ] + S[: len(S) - i]
  print(S[-i: ], S[: len(S) - i], U)
  if U == T or S == T:
    print('Yes')
    exit()
print('No')

S = input()
T = input()
for i in range(len(S)):
  U = S[-i: ] + S[: len(S) - i]
  if U == T or 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 deque from collections
s=list(input())
s=deque(s)
t=input()
fot i in range(len(s)):
  if ''.join(s)==t:
    print("Yes")
    exit()
  s.append(s.popleft())
print("No")

from collections import deque
s=list(input())
s=deque(s)
t=input()
for i in range(len(s)):
  if ''.join(s)==t:
    print("Yes")
    exit()
  s.append(s.popleft())
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()


def rotation(s):
    for x in range(len(s)):
        s = s[-1] + s[:-1]
        if s == t:
            return "YES"
    return "NO"

print(rotation(s))

s = input()
t = input()


def rotation(s):
    for x in range(len(s)):
        s = s[-1] + s[:-1]
        if s == t:
            return "Yes"
    return "No"

print(rotation(s))


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:
        return True
    else:
        S = S[-1] + S[:-1]

return False

p=input()
q=input()
s=len(p)
u=0
l=len(q)
for i in range(l):
    if p==q[i:s+i]:
        print("Yes")
        u=1
        break
if u==0:
    print("No")

p=input()
q=input()
q=2*q
s=len(p)
u=0
l=len(q)
for i in range(l):
    if p==q[i:s+i]:
        print("Yes")
        u=1
        break
if u==0:
    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 = list(input())
t = list(input())

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

s = input()
t = input()

ok = False
for i in range(len(s)):
  s = s[-1] + s[:-1]
  if s == t:
    ok = True
    break
if ok:
  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()
ans = 'No'
for i in range(len(S)):
    if S == T:
        ans = 'Yes'
        break
    S = S[-1] + S[1:]
print(ans)

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

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

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()
A=a*2
d= b in A
if d=="True"
    print("Yes")
else:
    print("No")


a=input()
b=input()
A=a*2
d= b in A
if d="True"
    print("Yes")
else:
    print("No")

a=input()
b=input()
A=a*2
d= b in A
if d=="True":
    print("Yes")
else:
    print("No")


from collections import deque
s=deque(list(input()))
t=deque(list(input()))
for i in range(120):
  s.rotate(1)
  if s==t:
    print("Yes")
    exit()
print("No")

Verdicts: 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()
if s in t = input() * 2:
  print('Yes')
else:
  print('No')

s = input()
if s in input() * 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 = list(input())
t = input()
flag = False
for i in range(len(s)-1):
    if "".join(s) == t:
        flag = True
        break
    else:
        flag = False
    w = s[0]
    for j in range(len(s)-1):
        s[j] = s[j+1]
    s[-1] = w
    print(s)
if flag:
    print("Yes")
else:
    print("No")

s = list(input())
t = input()
flag = False
for i in range(len(s)):
    if "".join(s) == t:
        flag = True
        break
    else:
        flag = False
    w = s[0]
    for j in range(len(s)-1):
        s[j] = s[j+1]
    s[-1] = w
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=input()
t=input()
if t in [s[i:]+s[:i] for i in range(len(s)]:
	print('Yes')
else:
	print('No')

s=input()
t=input()
if t in [s[i:]+s[:i] for i in range(len(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):
N = int(input())
A = list(map(int, input().split()))
print(max(A)-min(A))


S = input()
T = input()

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

print("Yes" if ans 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()

n = len(S)
e = 0
for i in range(n):
    R = S[i:n] + S[0:i]
    if T == R:
        print("yes")
        e = 1
        break

if e == 0:
    print("no")


S = input()
T = input()

n = len(S)
e = 0
for i in range(n):
    R = S[i:n] + S[0:i]
    if T == R:
        print("Yes")
        e = 1
        break

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

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

S = input()
T = input()
if S == T:
    print('Yes')
    exit()

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

print(S == T)

S = input()
T = input()

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


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

S=input()
T=input()
if(len(S)==len(T)):
    length=len(S)
    i=0
    while(i<length):
        if(S==T):
            print('Yes')
            break
        S=S[-1]+S[0:-1]
        i+=1
    if i==length:
        print('No')
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):
a=input()
b=input()
h=0
t=False
while h<len(a):
    if a==b:
        print("YES")
        t=True
        break
    a=a[len(a)-1]+a[:len(a)-1]
    
    h+=1
if t==False:
    print("NO")


a=input()
b=input()
h=0
t=False
while h<len(a):
    if a==b:
        print("Yes")
        t=True
        break
    a=a[len(a)-1]+a[:len(a)-1]
    
    h+=1
if t==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):
a=input()
t=input()
for i in range(len(a)):
  S=a[-i:]+a[:-i]
  if S==t:
    print("YES")
    break
else:
  print("No")

a=input()
t=input()
for i in range(len(a)):
  S=a[-i:]+a[:-i]
  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):

def f(S):
    sets = {}
    for s in S:
        sets[s] = sets.setdefault(s, 0) + 1
    return sets
S = input()
T = input()
setS = f(S)
setT = f(T)

for k, v in setS.items():
    if setT.setdefault(k, 0) != v:
        print("No")
        break
else:
    N = len(S)
    for n in range(N):
        if S == T:
            print("Yes")
            break
        S = S[N-1] + S[0:N-1]
        print(S)
    else:
        print("No")

def f(S):
    sets = {}
    for s in S:
        sets[s] = sets.setdefault(s, 0) + 1
    return sets
S = input()
T = input()
setS = f(S)
setT = f(T)

for k, v in setS.items():
    if setT.setdefault(k, 0) != v:
        print("No")
        break
else:
    N = len(S)
    for n in range(N):
        if S == T:
            print("Yes")
            break
        S = S[N-1] + S[0:N-1]
    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):
import sys

moji_S=list(input())
moji_T=list(input())


for i in range(len(moji_S)):
	cut=moji_S.pop()
	moji_S.insert(0,cut)
	print(moji_S)
	if moji_S==moji_T:
		print('Yes')
		sys.exit()

print('NO')		

moji_S=input()
moji_T=input()

flag=0
for i in range(len(moji_S)):
	if moji_S==moji_T:
		flag =1
		break
	s=s[-1]+s[0:len-1]
if flag:
	print("Yes")
else:
	print("No")



import sys

moji_S=list(input())
moji_T=list(input())


for i in range(len(moji_S)):
	cut=moji_S.pop()
	moji_S.insert(0,cut)
	print(moji_S)
	if moji_S==moji_T:
		print('Yes')
		sys.exit()

print('NO')		

#! python3

moji_S=input()
moji_T=input()

flag=0
for i in range(len(moji_S)):
	if moji_S==moji_T:
		flag =1
		break
	moji_S=moji_S[-1]+moji_S[0:-1]
if flag:
	print("Yes")
else:
	print("No")

Verdicts: Wrong Answer

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

import math
import heapq
import sys
import re
from collections import Counter
import datetime
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN




S=input()
T=input()
for i in range(len(S)):
    if S!=T:
        S=S[-1]+S[:-1]
    else:
        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()
flag = False
tmp_S = S

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

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

S = input()
T = input()
flag = False
tmp_S = S

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

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

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

S=input()
T=input()

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

S=input()
T=input()

for i in range(100):
  if S[-i:]+S[0:len(S)-i] ==T:
    print("Yes")
    break
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()
S_l = len(S)
while S_l != 0:
    if S == T:
        print("Yes")
        break
    S = S[-1]+S[0:-1]
    print(S)
    S_l -= 1
if S_l == 0:
    print("No")

S = input()
T = input()
S_l = len(S)
while S_l != 0:
    if S == T:
        print("Yes")
        break
    S = S[-1]+S[0:-1]
    S_l -= 1
if S_l == 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):
# coding: utf-8
S = input()
T = input()
for i in range(len(T)):
    if S == T:
        print('Yes')
        exit()
    else:
        S = S[-1] + S[:-1]
        print(S)
print('No')

# coding: utf-8
S = input()
T = input()
for i in range(len(T)):
    if S == T:
        print('Yes')
        exit()
    else:
        S = S[-1] + 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=list(input())
t=list(input())
ans="No"
for i in range(n):
    s=list(s[n])+s[0:n]
    if s==t:
        ans="Yes"
        break
print(ans)

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

s=input()
t=input()
r=""

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

s=input()
t=input()
st=s
ans="No"

for i in range(len(s)):
  st=st[-1]+st[:-1]
  if st==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):
s = input()
t = input()

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

import sys

s = input()
t = input()

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


import sys

s = input()
t = input()

for i in range(len(s)):
    s = s[-1] + 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 = list(input())
T = input()

print(S)
print(T)
for i in range(len(S)):
    check_str = "".join(S[i:len(S)] + S[0:i])
    #print(check_str)
    if check_str == T:
        print("Yes")
        exit()

print("No")


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

#print(S)
#print(T)
for i in range(len(S)):
    check_str = "".join(S[i:len(S)] + S[0:i])
    #print(check_str)
    if check_str == 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 = list(map(int,input().split()))
a.sort()
print(abs(a[0]-a[1])+abs(a[1]-a[2]))

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

for i in range(len(s)):
    a = s[-1]
    s.pop(-1)
    s.insert(0,a)
    a = []
    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 = list(input())
a = input()

success = False
for _l in range(len(s)):
    print(s)
    if ''.join(s) == a:
        success = True
        break
    s.insert(0, s.pop())

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


s = list(input())
a = input()

success = False
for _l in range(len(s)):
    if ''.join(s) == a:
        success = True
        break
    s.insert(0, s.pop())

print("Yes" if success 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()
ans = ""
for i in list(s):
	if i == "0" or i == "1":
		ans += i
	else:
		ans = ans[:-1]
print (ans)

s = input()
t = input()
for i in range(len(s)):
	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=str(input())
t=str(input())
print(s in t+t)

s=str(input())
t=str(input())
if(s in t+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):
x = input()
y = input()

for i in range(len(x)):
  if x[i:] + x[:i] == y:
    print('Yes')
  else:
    print('No')

x = input()
y = input()
b = 0
for i in range(len(x)):
  if x[i:] + x[:i] == y:
    b=1
    break


if b == 1:
  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(n):
  if s == t[i:] + t[:i]:
    print('Yes')
    exit(0)
print('No')

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


Verdicts: Runtime Error

Accepted