ZhenlongDai/ACPR huggingface dataset:
Problem: p03293
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
S = input()
T = input()
cnt = 0
s = S + S
ans=False
if S==T:
  ans=True
else:
  for i in range(len(S)):
    if s[i]==T[0]:
        for j in range(len(T)):
            if s[i+j]==T[j]:
                cnt +=1
        if cnt==len(T):
          ans=True
          
if ans==True:
  print('Yes')
else:
  print('No')



Failing test case input:
aaaaaaaaaaaaaaab
aaaabaaaaaaaaaaa

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
S = input()
T = input()
cnt = 0
s = S + S
ans=False
if S==T:
  ans=True
else:
  for i in range(len(S)):
    if s[i]==T[0]:
        for j in range(len(T)):
            if s[i+j]==T[j]:
                cnt +=1
        if (cnt%len(T))==0:
          ans=True
        cnt=0
          
if ans==True:
  print('Yes')
else:
  print('No')

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=str(input())
t=str(input())
a=0
while a<=100:
    a+=1
    s=s[-1]+s[:-2]
    if s==t:
        print("Yes")
        break
if a>100:
    print("No")
    

Failing test case input:
aaaaaaaaaaaaaaab
aaaaaaaaaaaaaaab

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
s=str(input())
t=str(input())
a=True
for i in range(len(s)):
    if s==t:
        a=False
        break
    s=s[-1]+s[:-1]
if a:
    print("No")
else:
    print("Yes")

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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')

Failing test case input:
ospyk
kmtyn

Expected output:
No


Actual output:
ospyk ospyk ospykospyk
k ospy kospy
yk osp ykosp
pyk os pykos
spyk o spyko
No


Fixed submission (verdict: Accepted):
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')

Problem: p03293
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
s = input()
t = input()
flag = True
for i in range(len(s)):
    if s[i] != t[-i-1]:
        flag = False
if flag:
    print("Yes")
else:
    print("No")


Failing test case input:
aaaaaaaaaaaaaaab
aaaabaaaaaaaaaaa

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
s = input()
t = input()
flag = False
for i in range(len(s)):
    if s == t:
        flag =True
    s = s[-1] + s[0:len(s)-1]
if flag:
    print("Yes")
else:
    print("No")

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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')

Failing test case input:
aaa`cbaaa`ba`bba
aaabaa`bbaaa`aba

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
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')
Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
T = input()

l = len(S)
count = 0

for i in range(l):
    for j in range(l):
        if i+j >= l:
            if S[i+j-l] == T[j]:
                count += 1
            else:
                break
        else:
            if S[i+j] == T[j]:
                count += 1
            else:
                break

    if count == l:
        print('Yes')
        exit()

print('No')

Failing test case input:
aaa`cbaaa`ba`bba
aaabaa`bbaaa`aba

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S = input()
T = input()

l = len(S)

for i in range(l):
    count = 0
    for j in range(l):
        if i+j >= l:
            if S[i+j-l] == T[j]:
                count += 1
            else:
                break
        else:
            if S[i+j] == T[j]:
                count += 1
            else:
                break

    if count == l:
        print('Yes')
        exit()

print('No')

Problem: p03293
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)

Failing test case input:
aaaaaaaaaaaaaaab
aaaabaaaaaaaaaaa

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
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)

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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

Failing test case input:
kzpso
lmtzn

Expected output:
No


Actual output:
nlmtz
znlmt
tznlm
mtznl
lmtzn
No


Fixed submission (verdict: Accepted):
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

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
t = input()

if set(s)==set(t):
    print('Yes')
else:
    print('No')

Failing test case input:
aaaaabaaabaaaaba
aaabaaaaaaabaaaa

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s = input()
t = input()
u = s+s
if t in u:
    print('Yes')
else:
    print('No')

Problem: p03293
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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")
        
else:
    print("No")

Failing test case input:
dbb
bas

Expected output:
No


Actual output:
bdb
bbd
No


Fixed submission (verdict: Accepted):
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")
Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
T = input()

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

Failing test case input:
bca
rca

Expected output:
No


Actual output:
bca
cab
abc
No


Fixed submission (verdict: Accepted):
S = input()
T = input()

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

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s1,s2 =input(),input()
for i in range(len(s1)):
    if(i==0):
        if(s1==s2):
            print("Yes")
            break
    print(s1[i:]+s1[:i],s2)
    if(s1[i:]+s1[:i] == s2):
        print("Yes")
        break
else:
    print("No")

Failing test case input:
aaaaaabaaaaaaaab
aaaaaaaaaaabaaaa

Expected output:
No


Actual output:
aaaaaabaaaaaaaab aaaaaaaaaaabaaaa
aaaaabaaaaaaaaba aaaaaaaaaaabaaaa
aaaabaaaaaaaabaa aaaaaaaaaaabaaaa
aaabaaaaaaaabaaa aaaaaaaaaaabaaaa
aabaaaaaaaabaaaa aaaaaaaaaaabaaaa
abaaaaaaaabaaaaa aaaaaaaaaaabaaaa
baaaaaaaabaaaaaa aaaaaaaaaaabaaaa
aaaaaaaabaaaaaab aaaaaaaaaaabaaaa
aaaaaaabaaaaaaba aaaaaaaaaaabaaaa
aaaaaabaaaaaabaa aaaaaaaaaaabaaaa
aaaaabaaaaaabaaa aaaaaaaaaaabaaaa
aaaabaaaaaabaaaa aaaaaaaaaaabaaaa
aaabaaaaaabaaaaa aaaaaaaaaaabaaaa
aabaaaaaabaaaaaa aaaaaaaaaaabaaaa
abaaaaaabaaaaaaa aaaaaaaaaaabaaaa
baaaaaabaaaaaaaa aaaaaaaaaaabaaaa
No


Fixed submission (verdict: Accepted):
s1,s2 =input(),input()
for i in range(len(s1)):
    if(i==0):
        if(s1==s2):
            print("Yes")
            break
    if(s1[i:]+s1[:i] == s2):
        print("Yes")
        break
else:
    print("No")

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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")

Failing test case input:
dac
rbb

Expected output:
No


Actual output:
no


Fixed submission (verdict: Accepted):
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")

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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")

Failing test case input:
dbb
rbb

Expected output:
No


Actual output:
no


Fixed submission (verdict: Accepted):
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")

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
T=input()
S=S[::-1]
if S==T:
  print("Yes")
else:
  print("No")

Failing test case input:
aaaaaaaaaaaaaaab
aaaaaaaaaaaaaaab

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
S=input()
T=input()
S=S*2
if T in S:
  print("Yes")
else:
  print("No")
Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
t = input()

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

Failing test case input:
kyoto
tokyo

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
s = input()
t = input()

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

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
t = input()

l = len(s)

for i in range(l + 1):
    if s == t:
        print("Yes")
        exit()
    t = t+t[0]
    t = t.lstrip(t[0])

print("No")

Failing test case input:
aaaaaaaaaaaaaaab
aaaabaaaaaaaaaaa

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
s = input()
t = input()

l = len(s)

for i in range(l):
    t = t + t[0]
    t = t[1:]
    if s == t:
        print("Yes")
        exit()

print("No")

Problem: p03293
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
def rolling(str , n):
    return str[n:len(str)] + str[:n]

S = input()
T = input()
for i in range(len(S)):
    if rolling(S, i) == T:
        print("Yes")
        exit()


Failing test case input:
aaaabbaaa`aaabba
aaabaaaaaaabaaba

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
def rolling(str , n):
    return str[n:len(str)] + str[:n]

S = input()
T = input()
for i in range(len(S)):
    if rolling(S, i) == T:
        print("Yes")
        exit()
print("No")

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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")

Failing test case input:
kzqso
qum{n

Expected output:
No


Actual output:
um{nq
kzqso
m{nqu
kzqso
{nqum
kzqso
nqum{
kzqso
qum{n
kzqso
No


Fixed submission (verdict: Accepted):
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")

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
abc
arc

Expected output:
No

Actual output:
['c', 'a', 'b']
['b', 'c', 'a']
['a', 'b', 'c']
No


Fixed submission (verdict: Accepted):
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)
Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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")

Failing test case input:
kyoto
tokyo

Expected output:
Yes

Actual output:
okyot
tokyo
Yes


Fixed submission (verdict: Accepted):
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")

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())
t = list(input())
for i in range(len(s)):
    tmp = s[-1]
    for j in range(len(s)-1)[::-1]:
        s[j+1] = s[j]
    s[0]=tmp
    if s == t:
        print("yes")
        break
else:
    print("no")

Failing test case input:
dac
sab

Expected output:
No


Actual output:
no


Fixed submission (verdict: Accepted):
s = list(input())
t = list(input())
for i in range(len(s)):
    tmp = s[-1]
    for j in range(len(s)-1)[::-1]:
        s[j+1] = s[j]
    s[0]=tmp
    if s == t:
        print("Yes")
        break
else:
    print("No")

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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")
  
  
  

Failing test case input:
aaaaaaaaaaaaaaab
aaaaaaaaaaaaaaab

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
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")

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
T = input()

N = len(S)

for i in range(1, N):
    if S[N-i:] + S[:N-i] == T:
        print('Yes')
        exit()
print('No')

Failing test case input:
aaaaaaaaaaaaaaab
aaaaaaaaaaaaaaab

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
S = input()
T = input()

N = len(S)

for i in range(N):
    if S[N-i:] + S[:N-i] == T:
        print('Yes')
        exit()
print('No')
Problem: p03293
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from collections import deque
s = input()
t = input()

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

Failing test case input:
aaaaaaaaaaaaaaab
aaaaaaaaaaaaaaab

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
from collections import deque
s = input()
t = input()

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

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
t=input()
if len(s)!=len(t):
	print("No")
	exit(0)
for i in t:
	if i not in s:
		print("No")
		exit(0)
for i in range(-1,len(s)):
	if s==t:
		print("Yes")
		break
	s=s[-1]+s[:-1]
	print(s)


Failing test case input:
aaa`cbaaa`ba`bba
aaabaaabbaaa`aba

Expected output:
No


Actual output:
aaaa`cbaaa`ba`bb
baaaa`cbaaa`ba`b
bbaaaa`cbaaa`ba`
`bbaaaa`cbaaa`ba
a`bbaaaa`cbaaa`b
ba`bbaaaa`cbaaa`
`ba`bbaaaa`cbaaa
a`ba`bbaaaa`cbaa
aa`ba`bbaaaa`cba
aaa`ba`bbaaaa`cb
baaa`ba`bbaaaa`c
cbaaa`ba`bbaaaa`
`cbaaa`ba`bbaaaa
a`cbaaa`ba`bbaaa
aa`cbaaa`ba`bbaa
aaa`cbaaa`ba`bba
aaaa`cbaaa`ba`bb


Fixed submission (verdict: Accepted):
s=input()
t=input()
for i in t:
	if i not in s:
		print("No")
		exit(0)
for i in range(-3,len(s)):
	if s==t:
		print("Yes")
		exit(0)
	s=s[-1]+s[:-1]
print("No")

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

def rotation(s,t):
    if sorted(s) != sorted(t):
        return False
    canRotate = False
    for int in range(len(s)-1):
        if s != t:
            temp = s[len(s)-1]
            s = s.rstrip(temp)
            s = temp + s
        elif s == t:
            canRotate = True
            break
    return canRotate

s = input()
t = input()
yesno = rotation(s,t)
if yesno == True:
    print('Yes')
else:
    print('No')


Failing test case input:
aaaaaaaaaaaaaaab
aaaabaaaaaaaaaaa

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):

def rotation(s,t):
    if sorted(s) != sorted(t):
        return False
    canRotate = False
    for int in range(len(s)):
        if s != t:
            s_list = list(s)
            temp = s_list.pop(len(s)-1)
            s = ''.join(s_list)
            s = temp + s
        elif s == t:
            canRotate = True
            break
    return canRotate

s = input()
t = input()
yesno = rotation(s,t)
if yesno == True:
    print('Yes')
else:
    print('No')
Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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')

Failing test case input:
aaa`cbaaa`ba`bba
abaaaaabbaaabaaa

Expected output:
No


Actual output:
aaaa`cbaaa`ba`bb
baaaa`cbaaa`ba`b
bbaaaa`cbaaa`ba`
`bbaaaa`cbaaa`ba
a`bbaaaa`cbaaa`b
ba`bbaaaa`cbaaa`
`ba`bbaaaa`cbaaa
a`ba`bbaaaa`cbaa
aa`ba`bbaaaa`cba
aaa`ba`bbaaaa`cb
baaa`ba`bbaaaa`c
cbaaa`ba`bbaaaa`
`cbaaa`ba`bbaaaa
a`cbaaa`ba`bbaaa
aa`cbaaa`ba`bbaa
aaa`cbaaa`ba`bba
No


Fixed submission (verdict: Accepted):
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')

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

def rotation(s,t):
    if sorted(s) != sorted(t):
        return False
    canRotate = False
    for int in range(len(s)):
        if s != t:
            temp = s[len(s)-1]
            s = s.rstrip(temp)
            s = temp + s
        elif s == t:
            canRotate = True
            break
    return canRotate

s = input()
t = input()
yesno = rotation(s,t)
if yesno == True:
    print('Yes')
else:
    print('No')


Failing test case input:
aaaaaaaaaaaaaaab
aaaabaaaaaaaaaaa

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):

def rotation(s,t):
    if sorted(s) != sorted(t):
        return False
    canRotate = False
    for int in range(len(s)):
        if s != t:
            s_list = list(s)
            temp = s_list.pop(len(s)-1)
            s = ''.join(s_list)
            s = temp + s
        elif s == t:
            canRotate = True
            break
    return canRotate

s = input()
t = input()
yesno = rotation(s,t)
if yesno == True:
    print('Yes')
else:
    print('No')

Problem: p03293
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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")

Failing test case input:
aaaaaaaaaaaaaaab
aaaabaaaaaaaaaaa

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
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")

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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")

Failing test case input:
aaa`dbaaa`aa`bba
abaabaaaaaaabaaa

Expected output:
No


Actual output:
no


Fixed submission (verdict: Accepted):
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")
Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
T = input()


if S == T :
    ans = "Yes"
else:
    list_S =list(S) 
    list_T =list(T) 
    L = list_S
    L  =  tuple(L)
    
    ans = "N0"
    
    for i in range(1,len(S)):
        
        for j in range(len(S)):
            list_S[j] = L[-i+j]
            
        print(list_S)
        
        if list_S == list_T :
            ans = "Yes"
            break
print(ans) 

Failing test case input:
baaaaaaaabaaaaaa
aaaaaaaaaaabaaaa

Expected output:
No


Actual output:
['a', 'b', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'b', 'a', 'a', 'a', 'a', 'a']
['a', 'a', 'b', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'b', 'a', 'a', 'a', 'a']
['a', 'a', 'a', 'b', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'b', 'a', 'a', 'a']
['a', 'a', 'a', 'a', 'b', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'b', 'a', 'a']
['a', 'a', 'a', 'a', 'a', 'b', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'b', 'a']
['a', 'a', 'a', 'a', 'a', 'a', 'b', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'b']
['b', 'a', 'a', 'a', 'a', 'a', 'a', 'b', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a']
['a', 'b', 'a', 'a', 'a', 'a', 'a', 'a', 'b', 'a', 'a', 'a', 'a', 'a', 'a', 'a']
['a', 'a', 'b', 'a', 'a', 'a', 'a', 'a', 'a', 'b', 'a', 'a', 'a', 'a', 'a', 'a']
['a', 'a', 'a', 'b', 'a', 'a', 'a', 'a', 'a', 'a', 'b', 'a', 'a', 'a', 'a', 'a']
['a', 'a', 'a', 'a', 'b', 'a', 'a', 'a', 'a', 'a', 'a', 'b', 'a', 'a', 'a', 'a']
['a', 'a', 'a', 'a', 'a', 'b', 'a', 'a', 'a', 'a', 'a', 'a', 'b', 'a', 'a', 'a']
['a', 'a', 'a', 'a', 'a', 'a', 'b', 'a', 'a', 'a', 'a', 'a', 'a', 'b', 'a', 'a']
['a', 'a', 'a', 'a', 'a', 'a', 'a', 'b', 'a', 'a', 'a', 'a', 'a', 'a', 'b', 'a']
['a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'b', 'a', 'a', 'a', 'a', 'a', 'a', 'b']
N0


Fixed submission (verdict: Accepted):
S = input()
T = input()


if S == T :
    ans = "Yes"
else:
    list_S =list(S) 
    list_T =list(T) 
    L = list_S
    L  =  tuple(L)
    ans = "No"
    
    for i in range(1,len(S)+1):
        
        for j in range(len(S)):
            list_S[j] = L[-i+j]
        if list_S == list_T :
            ans = "Yes"
            break
print(ans)

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())
t = list(input())
c = 0
for a in set(s):
    s.count(a) == t.count(a)
    c += s.count(a)
if c == len(s):
    print("Yes")
else:
    print("No")

Failing test case input:
bcb
abr

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s = list(input())
t = list(input())
c = 0
for a in range(len(s)):
    if s == t:
        c = 1
        break
    s.append(s[0])
    del s[0]
if c ==1:
    print("Yes")
    
else:
    print("No")
Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = str(input())
t = str(input())

st = False
for i in range(0,len(s)-1):
    s = s[-1]+s[0:len(s)-1]
    if s==t:
        st = True
        print("yes")
        break
if not st:
    print("No")

Failing test case input:
aaaaaaaaaaaaaaab
aaaaaaaaaaaaaaab

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
s = str(input())
t = str(input())

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

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
t = input()
p = len(s)
to = False
for i in range(p):
    s = s[-1:]+s[:4]
    if s==t:
        to = True
        print("Yes")
        break
if to == False:
    print("No")

Failing test case input:
aaaaaaaaaaaaaaab
aaaaaaaaaaaaaaab

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
s = input()
t = input()
p = len(s)
to = False
for i in range(p):
    s = s[-1:]+s[:p-1]
    if s==t:
        to = True
        print("Yes")
        break
if to == False:
    print("No")

Problem: p03293
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


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

    l = len(S)
    
    def judge():
        for i in range(1, l):
            U = S[l - i:] + S[:l - i]
            if U == T:
                return True
        return False
    
    if judge():
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()


Failing test case input:
aaaaaaaaaaaaaaab
aaaaaaaaaaaaaaab

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


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

    l = len(S)

    def judge():
        for i in range(l):
            U = S[l - i:] + S[:l - i]
            if U == T:
                return True
        return False

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

if __name__ == '__main__':
    main()

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
T=input()
l=len(S)
if S==T:
    print("Yes")
    exit()

for i in range(l):
    tmp=S[-1]
    S=S.strip(S[-1])
    new_string=tmp+S
    
    if new_string==T:
        print("Yes")
        exit()
    
    S=new_string

print("No")

Failing test case input:
aaaaaaaaaaaaaaab
aaaabaaaaaaaaaaa

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
S=input()
T=input()
l=len(S)

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

for i in range(l):
    S=S[-1]+S[0:-1]
    if S==T:
        print("Yes")
        exit()
print("No")
Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


def checkStr():
    sA = s1
    for i in range(len(s1)):
        sA = sA[len(s1) - 1:len(s1)] + sA[0:len(s1) - 1]
        print (sA)
        if sA == s2:
            return True
    return False

s1 = input()
s2 = input()
if checkStr():
    print ("Yes")
else:
    print ("No")


Failing test case input:
dbb
bra

Expected output:
No


Actual output:
bdb
bbd
dbb
No


Fixed submission (verdict: Accepted):


def checkStr():
    sA = s1
    for i in range(len(s1)):
        sA = sA[len(s1) - 1:len(s1)] + sA[0:len(s1) - 1]
        if sA == s2:
            return True
    return False

s1 = input()
s2 = input()
if checkStr():
    print ("Yes")
else:
    print ("No")

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
T = input()
L = len(S)
St = []
Tr = []
ans = 'no'
for i in range(L):
    St.append(S[i:i+1])
    Tr.append(T[i:i+1])

for i in range(L):
    if St == Tr:
        ans = 'yes'
        break
    else:
        St.insert(0,St[L-1])
        del St[L]

print(ans)



Failing test case input:
bca
rca

Expected output:
No


Actual output:
no


Fixed submission (verdict: Accepted):
S = input()
T = input()
L = len(S)
St = []
Tr = []
ans = 'No'
for i in range(L):
    St.append(S[i:i+1])
    Tr.append(T[i:i+1])

for i in range(L):
    if St == Tr:
        ans = 'Yes'
        break
    else:
        St.insert(0,St[L-1])
        del St[L]

print(ans)

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())
t = list(input())

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


Failing test case input:
aaaaaaaaaaaaaaab
aaaabaaaaaaaaaaa

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
s = list(input())
t = list(input())

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

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = list(input())
T = list(input())

for i in range(len(S)):
    if S == T:
        print('Yes')
        break
    elif S != T:
        S.insert(0,S[-1])
        del S[-1]
    elif i == len(S)-2:
        print('No')

Failing test case input:
osqzj
l{tnp

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
S = list(input())
T = list(input())

for i in range(len(S)):
    if S == T:
        print('Yes')
        break
    elif S != T:
        S.insert(0,S[-1])
        del S[-1]
    if i == len(S)-1:
        print('No')
Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s, t = input(), input()
if s == t:
    print('Yes')
    exit(0)
for i in range(1, len(s)):
    print(s[:i], s[i:])
    print(t[-i:], t[:-i])
    if s[:i] == t[-i:] and s[i:] == t[:-i]:
        print('Yes')
        exit(0)
print('No')

Failing test case input:
aaaaaaaaaaaaaaab
aaaabaaaaaaaaaaa

Expected output:
Yes


Actual output:
a aaaaaaaaaaaaaab
a aaaabaaaaaaaaaa
aa aaaaaaaaaaaaab
aa aaaabaaaaaaaaa
aaa aaaaaaaaaaaab
aaa aaaabaaaaaaaa
aaaa aaaaaaaaaaab
aaaa aaaabaaaaaaa
aaaaa aaaaaaaaaab
aaaaa aaaabaaaaaa
aaaaaa aaaaaaaaab
aaaaaa aaaabaaaaa
aaaaaaa aaaaaaaab
aaaaaaa aaaabaaaa
aaaaaaaa aaaaaaab
aaaaaaaa aaaabaaa
aaaaaaaaa aaaaaab
aaaaaaaaa aaaabaa
aaaaaaaaaa aaaaab
aaaaaaaaaa aaaaba
aaaaaaaaaaa aaaab
aaaaaaaaaaa aaaab
Yes


Fixed submission (verdict: Accepted):
s, t = input(), input()
if s == t:
    print('Yes')
    exit(0)
for i in range(1, len(s)):
    if s[:i] == t[-i:] and s[i:] == t[:-i]:
        print('Yes')
        exit(0)
print('No')

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
T = input()


if S == T :
    ans = "Yes"
else:
    list_S =list(S) 
    list_T =list(T) 
    L = list_S
    L  =  tuple(L)
    
    ans = "N0"
    
    for i in range(1,len(S)+1):
        
        for j in range(len(S)):
            list_S[j] = L[-i+j]
            
        print(list_S)
        
        if list_S == list_T :
            ans = "Yes"
            break
print(ans) 

Failing test case input:
bcb
abr

Expected output:
No


Actual output:
['b', 'b', 'c']
['c', 'b', 'b']
['b', 'c', 'b']
N0


Fixed submission (verdict: Accepted):
S = input()
T = input()


if S == T :
    ans = "Yes"
else:
    list_S =list(S) 
    list_T =list(T) 
    L = list_S
    L  =  tuple(L)
    ans = "No"
    
    for i in range(1,len(S)+1):
        
        for j in range(len(S)):
            list_S[j] = L[-i+j]
        if list_S == list_T :
            ans = "Yes"
            break
print(ans)

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


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

Failing test case input:
aaaaaaaaaaaaaaab
aaaaaaaaaaaaaaab

Expected output:
Yes

Actual output:
Yes
Yes


Fixed submission (verdict: Accepted):
S = input()
T = input()
f=0
for i in range(len(S)):
    if S == T:
        f=1
    S = (S[-1]+S)[:-1]

if f==0:
    print('No')
else:
    print('Yes')
Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):



def main():
    S = input().strip()
    T = input().strip()
    move = S[-1]+S[:-1]
    j = True
    if S == T:
        print("Yes")
    if move == T:
        print("Yes")
        j = False
    while j:
        move = move[-1]+move[:-1]
        if move == T:
            print("Yes")
            j = False
        elif move == S:
            print("No")
            j = False


if __name__ == '__main__':
    main()


Failing test case input:
aaaaaaaaaaaaaaab
aaaaaaaaaaaaaaab

Expected output:
Yes

Actual output:
Yes
Yes


Fixed submission (verdict: Accepted):



def main():
    S = input().strip()
    T = input().strip()
    move = S[-1]+S[:-1]
    j = True
    if move == T:
        print("Yes")
        j = False
        exit()
    while j:
        move = move[-1]+move[:-1]
        if move == T:
            print("Yes")
            j = False
        elif move == S:
            print("No")
            j = False


if __name__ == '__main__':
    main()

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S =list(input())
T = input()

ans = 0
for i in  range(len(S)-1):
    A=S[-1]
    S.pop(-1)
    S.insert(0,A)
    B=''.join(S)
    if B.lower() == T.lower():
        ans +=1
if ans != 0:
    print('Yes')
else:
    print('No')

Failing test case input:
aaaaaaaaaaaaaaab
aaaaaaaaaaaaaaab

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
S =input()
T = input()

s = list(S)
ans = 0

if S.lower() == T.lower():
        ans +=1

for _ in  range(len(s)-1):
    A=s[-1]
    s.pop(-1)
    s.insert(0,A)
    
    B=''.join(s)
    if B.lower() == T.lower():
        ans +=1
if ans != 0:
    print('Yes')
else:
    print('No')

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
from sys import stdin
s = list(stdin.readline().rstrip())
t = list(stdin.readline().rstrip())
for i in range(len(s)):
    s=list(s[-1])+s[:len(s)-1]
    print(s)
    if s==t:
        print('Yes')
        sys.exit()
print('No')


Failing test case input:
dab
rbb

Expected output:
No


Actual output:
['b', 'd', 'a']
['a', 'b', 'd']
['d', 'a', 'b']
No


Fixed submission (verdict: Accepted):
import sys
from sys import stdin
s = list(stdin.readline().rstrip())
t = list(stdin.readline().rstrip())
for i in range(len(s)):
    s=list(s[-1])+s[:len(s)-1]
    if s==t:
        print('Yes')
        sys.exit()
print('No')

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=list(input())
t=list(input())
n=len(s)-1
ans="No"
for i in range(n):
    s=list(s[n])+s[0:n]
    if s==t:
        ans="Yes"
        break
print(ans)

Failing test case input:
aaaaaaaaaaaaaaab
aaaaaaaaaaaaaaab

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
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)
Problem: p03293
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
def ans(s,t):
    for i in range(len(s)):
        s = s[-1] + s[:-1]

        if s == t:
            return "Yes"
    return "No"

s = input()
t = input()

if s == t:
    print("Yes")

ans = ans(s,t)

print(ans)

Failing test case input:
aaaaaaaaaaaaaaab
aaaaaaaaaaaaaaab

Expected output:
Yes

Actual output:
Yes
Yes


Fixed submission (verdict: Accepted):
def ans(s,t):
    for i in range(len(s)):
        s = s[-1] + s[:-1]

        if s == t:
            return "Yes"
    return "No"

s = input()
t = input()

ans = ans(s,t)

print(ans)

Problem: p03293
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
s = input()
t = input()

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

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

Failing test case input:
kyoto
tokyo

Expected output:
Yes

Actual output:
yes


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

Problem: p03293
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = str(input())
t = str(input())

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

print('No')

Failing test case input:
aaaaaaaaaaaaaaab
aaaaaaaaaaaaaaab

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
s = str(input())
t = str(input())

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

print('No')
Problem: p03308
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = list(map(int, input().split()))
print(max(a)-min(a))

Failing test case input:
4
1 4 6 3

Expected output:
5

Actual output:
0


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
print(max(a)-min(a))

Problem: p03308
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from sys import stdin
data=[int(x) for x in stdin.readline().rstrip().split()]
data=sorted(data)
print(abs(data[0]-data[-1]))

Failing test case input:
4
1 4 6 3

Expected output:
5

Actual output:
0


Fixed submission (verdict: Accepted):
from sys import stdin
N=int(stdin.readline().rstrip())
data=[int(x) for x in stdin.readline().rstrip().split()]
data=sorted(data)
print(abs(data[0]-data[-1]))

Problem: p03308
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
A=list(map(int,input().split()))
max=0

for i in range(1,N-1):
  for j in range(i+1,N):
    if abs(A[i]-A[j])>=max:
      max=abs(A[i]-A[j])
print(max)

Failing test case input:
4
1 4 6 3

Expected output:
5

Actual output:
3


Fixed submission (verdict: Accepted):
N=int(input())
A=list(map(int,input().split()))
max=0

for i in range(0,N-1):
  for j in range(i+1,N):
    if abs(A[i]-A[j])>=max:
      max=abs(A[i]-A[j])
print(max)

Problem: p03308
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

N = int(input())
print(N)
list_A = [int(str_A) for str_A in input().split(" ")]
print(list_A)

print(max(list_A) - min(list_A))

Failing test case input:
4
1 4 6 3

Expected output:
5

Actual output:
4
[1, 4, 6, 3]
5


Fixed submission (verdict: Accepted):
N = int(input())
list_A = [int(str_A) for str_A in input().split(" ")]

print(max(list_A) - min(list_A))

Problem: p03308
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = list(map(int, input().split()))
a.sort()
print(a[-1] - a[0])


Failing test case input:
4
1 4 6 3

Expected output:
5

Actual output:
0


Fixed submission (verdict: Accepted):
n = int(input())
S = list(map(int, input().split()))
S = sorted(S)
print(S[-1] - S[0])

Problem: p03308
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
l = []
for i in range(len(a)):
    for j in range(i,len(a)):
        l.append(abs(a[i]-a[j]))
print(max(a))


Failing test case input:
4
1 4 6 3

Expected output:
5

Actual output:
6


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
l = []
for i in range(len(a)):
    for j in range(i,len(a)):
        l.append(abs(a[i]-a[j]))
print(max(l))

Problem: p03308
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n = int(input())
a = list(map(int,input().split()))
a = sorted(a)
print(a)
print(a[n-1]-a[0])

Failing test case input:
4
1 4 6 3

Expected output:
5

Actual output:
[1, 3, 4, 6]
5


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int,input().split()))
a = sorted(a)
print(a[n-1]-a[0])
Problem: p03308
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
count=input()
list=input().rstrip().split(" ")
sa = int(list[0])-int(list[1])
for i in range(len(list)):
  if sa<(int(list[i-1])-int(list[i])):
    sa=(int(list[i-1])-int(list[i]))
if sa<0:
  print(-1*sa)
else:
  print(sa)

Failing test case input:
4
1 4 6 3

Expected output:
5

Actual output:
3


Fixed submission (verdict: Accepted):
count=input()
list=input().rstrip().split(" ")
list_1=[int(s) for s in list]
list2= sorted(list_1)
sa=(int(list2[0])-int(list2[int(count)-1]))
if sa<0:
  print(-1*int(sa))
else:
  print(int(sa))

Problem: p03308
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a=open(0);s=sorted(map(int,a.split()));print(s[-1]-s[1])

Failing test case input:
4
1 4 6 3

Expected output:
5

Actual output:
3


Fixed submission (verdict: Accepted):
n,a=open(0);s=sorted(map(int,a.split()));print(s[-1]-s[0])

Problem: p03308
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
A=list(map(int,input().split()))
A=sorted(A)
ans=A[n-1]-A[1]
print(ans)

Failing test case input:
4
1 4 6 3

Expected output:
5

Actual output:
3


Fixed submission (verdict: Accepted):
n=int(input())
A=list(map(int,input().split()))
A=sorted(A)
ans=A[n-1]-A[0]
print(ans)

Problem: p03308
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def B():
    n = int(input())
    a = input().split()
    
    if(len(a) != n):
        exit(1)

    i_max = 0
    i_min = 1000000001
    for i in a:
        k = int(i)
        if (i_max < k):
                i_max = k
        if (i_min > k):
                i_min = k
    print(i_max,i_min)
    print(abs( i_max - i_min))

if __name__ =='__main__':
    B()

Failing test case input:
4
1 4 6 3

Expected output:
5

Actual output:
6 1
5


Fixed submission (verdict: Accepted):

def B():
    n = int(input())
    a = input().split()
    
    if(len(a) != n):
        exit(1)

    i_max = 0
    i_min = 1000000001
    for i in a:
        k = int(i)
        if (i_max < k):
                i_max = k
        if (i_min > k):
                i_min = k
    print(abs( i_max - i_min))

if __name__ =='__main__':
    B()

Problem: p03308
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


import sys
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

N = int(readline().rstrip())
lis = list(map(int, readline().rstrip().split()))
sorted(lis)

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


Failing test case input:
4
1 4 6 3

Expected output:
5

Actual output:
2


Fixed submission (verdict: Accepted):


import sys
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

N = int(readline().rstrip())
lis = list(map(int, readline().rstrip().split()))
a = sorted(lis)

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

Problem: p03308
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = list(map(int, input().split()))

print(abs(max(N) - min(N)))

Failing test case input:
4
1 4 6 3

Expected output:
5

Actual output:
0


Fixed submission (verdict: Accepted):
_, N = input(), list(map(float, input().split()))

print(int(abs(max(N) - min(N))))
Problem: p03308
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
_ = input()
a = sorted(map(int, input().split()))
print(a[0]-a[-1])

Failing test case input:
4
1 4 6 3

Expected output:
5

Actual output:
-5


Fixed submission (verdict: Accepted):
_ = input()
a = sorted(map(int, input().split()))
print(a[-1]-a[0])

Problem: p03308
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = sorted(map(int,input().split()))
print(abs(x[-1]-x[0]))

Failing test case input:
4
1 4 6 3

Expected output:
5

Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
x = sorted(map(int,input().split()))
print(abs(x[-1]-x[0]))

Problem: p03308
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split()))
d=[]
import itertools
for v in itertools.combinations(a,2):
    
    d.append(abs(v[0]-v[1]))
print(min(d))

Failing test case input:
4
1 4 6 3

Expected output:
5

Actual output:
1


Fixed submission (verdict: Accepted):
n=int(input())
a=list(map(int,input().split()))
d=[]
import itertools
for v in itertools.combinations(a,2):
    
    d.append(abs(v[0]-v[1]))
print(max(d))

Problem: p03308
Buggy submission (Python (3.4.3), verdict: Wrong Answer):



n = (int)(input())
list = list(int(i) for i in input().split())
print(list)
mx = max(list)
mn = min(list)
print(mx - mn)

Failing test case input:
4
1 4 6 3

Expected output:
5

Actual output:
[1, 4, 6, 3]
5


Fixed submission (verdict: Accepted):



n = (int)(input())
list = list(int(i) for i in input().split())
mx = max(list)
mn = min(list)
print(mx - mn)

Problem: p03308
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = [int(i) for i in range(n)]
print(max(a) - min(a))


Failing test case input:
4
1 4 6 3

Expected output:
5

Actual output:
3


Fixed submission (verdict: Accepted):
n = int(input())
a = [int(i) for i in input().split()]
print(max(a) - min(a))

Problem: p03308
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
a = list(map(int, input().split()))
max = 0
for i in range(len(a)+1):
  for j in range(i+1, len(a)):
    print(i, j)
    if max < abs(a[i] - a[j]):
      max = abs(a[i] - a[j])
print(max)

Failing test case input:
4
1 4 6 3

Expected output:
5

Actual output:
0 1
0 2
0 3
1 2
1 3
2 3
5


Fixed submission (verdict: Accepted):
N = int(input())
a = list(map(int, input().split()))
max = 0
for i in range(len(a)+1):
  for j in range(i+1, len(a)):
    
    if max < abs(a[i] - a[j]):
      max = abs(a[i] - a[j])
print(max)

Problem: p03308
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
arr=list(map(int,input().split()))
print(abs(arr[-1]-arr[0]))

Failing test case input:
4
1 4 6 3

Expected output:
5

Actual output:
2


Fixed submission (verdict: Accepted):
n=int(input())
arr=list(map(int,input().split()))
arr.sort()
print(abs(arr[-1]-arr[0]))
Problem: p03308
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a_list = [int(i) for i in input().split()]
d_list =[]

for i in range(n):
	for j in range(n-i):
		print(i,n-j-1)
		d_list.append(abs(a_list[i]-a_list[n-j-1]))
		
print(max(d_list))

Failing test case input:
4
1 4 6 3

Expected output:
5

Actual output:
0 3
0 2
0 1
0 0
1 3
1 2
1 1
2 3
2 2
3 3
5


Fixed submission (verdict: Accepted):
n = int(input())
a_list = [int(i) for i in input().split()]
d_list =[]

for i in range(n):
	for j in range(n-i):
		
		d_list.append(abs(a_list[i]-a_list[n-j-1]))
		
print(max(d_list))

Problem: p03308
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = list(map(int, input().split()))
print(max(a)-min(a))

Failing test case input:
4
1 4 6 3

Expected output:
5

Actual output:
0


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
print(max(a)-min(a))

Problem: p03308
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input("input N ,")) 
lista=input("input A ,").split() 
p=int(lista[0])
q=int(lista[0])
for i in range(1,n):
    k=int(lista[i])
    if k<=p:
        p=k
    elif k>=q:
        q=k
print(int(q)-int(p))

Failing test case input:
4
1 4 6 3

Expected output:
5

Actual output:
input N ,input A ,5


Fixed submission (verdict: Accepted):
n=int(input()) 
lista=input().split() 
p=int(lista[0])
q=int(lista[0])
for i in range(1,n):
    k=int(lista[i])
    if k<=p:
        p=k
    elif k>=q:
        q=k
print(int(q-p))

Problem: p03308
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = input().split(" ")
B = [int(n) for n in A]

m = 0
M = 0
for b in B:
  if b < m:
    m = b
  
  if b > M:
    M = b

print(M-m)

Failing test case input:
4
1 4 6 3

Expected output:
5

Actual output:
6


Fixed submission (verdict: Accepted):
N = int(input())
A = input().split(" ")
B = [int(n) for n in A]
             
m = float("inf")
M = 0
for b in B:
  if b < m:
    m = b
              
  if b > M:
    M = b
             
print(M-m)

Problem: p03308
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=list(map(int,input().split()))
print(max(a)-min(a))

Failing test case input:
4
1 4 6 3

Expected output:
5

Actual output:
0


Fixed submission (verdict: Accepted):
o=input()
a=list(map(int,input().split()))
print(max(a)-min(a))

Problem: p03308
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
list =  [int(i) for i in input().split()]
print(list)
print(max(list) - min(list))

Failing test case input:
4
1 4 6 3

Expected output:
5

Actual output:
[1, 4, 6, 3]
5


Fixed submission (verdict: Accepted):
N = int(input())
list =  [int(i) for i in input().split()]
print(max(list) - min(list))