ZhenlongDai/ACPR huggingface dataset:
Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C = map(int, input().split())
print("{} {} {}".format(A, B, C))


norm_A = 0
norm_B = B - A
norm_C = C - A

print('Yes' if abs(norm_B) >= abs(norm_C) else 'No')

Failing test case input:
5 5 1

Expected output:
No


Actual output:
5 5 1
No


Fixed submission (verdict: Accepted):
A, B, C = map(int, input().split())


norm_A = 0
norm_B = B - A
norm_C = C - A

print('Yes' if abs(norm_B) >= abs(norm_C) and (norm_B * norm_C) > 0 else 'No')

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
r_str = input()
r_str = r_str.split()
r = [int(s) for s in r_str]
a = 'Yes'
 
if r[0] <= r[1]:
    if r[0] <= r[2]:
        a = 'Yes'
    else:
        a = 'No'
else:
    if r[1] <= r[2]:
        a = 'Yes'
    else:
        a = 'No'
 
print(a)

Failing test case input:
-2 -1 2

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
r_str = input()
r_str = r_str.split()
r = [int(s) for s in r_str]
a = 'Yes'
 
if r[0] <= r[1]:
    if r[0] <= r[2] and r[2] <= r[1]:
        a = 'Yes'
    else:
        a = 'No'
else:
    if r[1] <= r[2] and r[2] <= r[0]:
        a = 'Yes'
    else:
        a = 'No'
 
print(a)

Problem: p03067
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
a,b,c = map(int,input().split())
if a < b <c:
  print("Yes")
else:
  print("No")

Failing test case input:
4 8 7

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
a,b,c = map(int,input().split())
if a < c <b or a > c > b:
  print("Yes")
else:
  print("No")

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
ABC = input().split()
list_ABC = list(ABC)
A = list_ABC[0]
B = list_ABC[1]
C = list_ABC[2]

if A < C and C < B:
    print('Yes')
elif B < C and C < A:
    print('Yes')
else:
    print('No')

Failing test case input:
3 16 5

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
ABC = input().split()
list_ABC = list(ABC)
A = int(list_ABC[0])
B = int(list_ABC[1])
C = int(list_ABC[2])
 
if A < C and C < B:
    print('Yes')
elif B < C and C < A:
    print('Yes')
else:
    print('No')

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int, input().split())
print("Yes" if (c-a)*(c-b)>0 else "No")

Failing test case input:
51 38 0

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
a,b,c = map(int, input().split())
print("No" if (c-a)*(c-b)>0 else "Yes")

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int ,input().split())
print("No" if (a<b and b<c) or (c<b and b<a) else "Yes")

Failing test case input:
5 5 0

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
a,b,c = map(int ,input().split())
print("Yes" if (a<c and c<b) or (b<c and c<a) else "No")
Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = list(map(int,input().split(" ")))

if((a>b and c>b) or (a<b and c<b)):
    print("Yes")
else:
    print("No")

Failing test case input:
3 79 1

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
a,b,c = list(map(int,input().split(" ")))

if((a>b and b<c<a) or (a<b and b>c>a)):
    print("Yes")
else:
    print("No")

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int, input().split())

if a < b:
    if b < c:
        print('Yes')
    else:
        print('No')
else:
    if b < c:
        print('Yes')
    else :
        print('No')


Failing test case input:
39 69 59

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
a,b,c = map(int, input().split())

if a < b:
    if a < c < b:
        print('Yes')
    else :
        print('No')
else:
    if a > c > b:
        print('Yes')
    else:
        print('No')

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int, input().split())

if a <= b <= c:
    print('Yes')
else:
    print('No')



Failing test case input:
31 41 75

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
a,b,c = map(int, input().split())

if a<c<b:
    print('Yes')
elif b<c<a:
    print('Yes')
else:
    print('No')

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = input().split(" ")
if sorted([a,b])[0] <= c and c <= sorted([a,b])[1]:
    print("Yes")
else:
    print("No")

Failing test case input:
3 16 5

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split(" "))
if sorted([a,b])[0] < c and c < sorted([a,b])[1]:
    print("Yes")
else:
    print("No")

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


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

if (c > a and c < b) or (c < a and c > b):
    print('No')
else:
    print('Yes')




Failing test case input:
3 8 7

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):


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

if a < c < b or b < c < a:
    print('Yes')
else:
    print('No')

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def check_between(a,b,c):
    if  (b < c) and (c < a) :
        print('YES')
    elif (a < c) and (c <b) :
        print('YES')
    else:
        print('NO')

a, b, c = map(int, input().split())
check_between(a,b, c)

Failing test case input:
31 49 59

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
def check_between(a,b,c):
    if  (b < c) and (c < a) :
        print('Yes')
    elif (a < c) and (c <b) :
        print('Yes')
    else:
        print('No')

a, b, c = map(int, input().split())
check_between(a,b,c)
Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):




def main():
	a, b, c = map(int, input().split())
	if a < b and c < b:
		print('Yes')
	else:
		print('No')





if __name__ == '__main__':
	import sys
	sys.exit(main())



Failing test case input:
3 79 0

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):




def main():
	a, b, c = map(int, input().split())
	if a < c < b or b < c < a:
		print('Yes')
	else:
		print('No')

if __name__ == '__main__':
	import sys
	sys.exit(main())

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int, input().split())
if a < b: 
    if a < c and c < b:
        print("Yes")
    else:
        print("No")
else :
    if a > c and b > c:
        print("Yes")
    else:
        print("No")

Failing test case input:
84 49 0

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
a,b,c = map(int, input().split())
if a < b:
    if a < c and c < b:
        print("Yes")
    else:
        print("No")
else:
    if a > c and c > b:
        print("Yes")
    else:
        print("No")

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=list(map(int,input().split()))
if (max(a)!=a[1])&(min(a)!=a[1]):
	print('Yes')
else:
	print('No')

Failing test case input:
9 0 -1

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
a=list(map(int,input().split()))
if (max(a)!=a[2])&(min(a)!=a[2]):print('Yes')
else:print('No')

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
abc=list(map(int,input().split()))
if max(abc)==abc[0] and min(abc)==abc[2] or max(abc)==abc[2] and min(abc)==abc[0]:
  print("Yes")
else:
  print("No")


Failing test case input:
-4 -1 0

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
abc=list(map(int,input().split()))
if max(abc)==abc[0] and min(abc)==abc[1] or max(abc)==abc[1] and min(abc)==abc[0]:
  print("Yes")
else:
  print("No")

Problem: p03067
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
a, b, c = [ int(v) for v in input().split() ]
if a < b:
  a, b = b, a
print( "Yes" if a <= c <= b else "No" )
  

Failing test case input:
3 8 7

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
a, b, c = [ int(v) for v in input().split() ]
if b < a:
  a, b = b, a
print( "Yes" if a <= c <= b else "No" )

Problem: p03067
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b,c = map(int, input().split())
print("Yes" if min(a,b) < c and max(a,b) > c else "no")

Failing test case input:
0 -2 2

Expected output:
No


Actual output:
no


Fixed submission (verdict: Accepted):
a,b,c = map(int, input().split())
print("Yes" if min(a,b) < c and max(a,b) > c else "No")

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = map(int, input().split())

if b == max(a, b, c) or b == min(a, b, c):
	print('Yes')
else:
	print('No')

Failing test case input:
51 86 10

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())

if a < c < b or b < c < a:
	print('Yes')
else:
	print('No')
Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
a, b, c = [int(_) for _ in s.split()]

if abs(b-a) > abs(c-a):
    print("Yes")
else:
    print("No")


Failing test case input:
3 79 1

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s = input()
a, b, c = [int(_) for _ in s.split()]
a, b, c = [_-a for _ in (a, b, c)]

if b * c > 0 and abs(b) > abs(c):
    print("Yes")
else:
    print("No")

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = map(int, input().split())
if b > a:
    if b > c:
        print("Yes")
    else:
        print("No")
elif a > b:
    if a < c:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Failing test case input:
3 79 1

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())
if b > a:
    if b > c and a < c:
        print("Yes")
    else:
        print("No")
elif a > b:
    if a > c and b < c:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int,input().split())
if a < b < c or c < b < a:
  print("Yes")
else:
  print("No")

Failing test case input:
31 49 59

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
a,b,c = map(int,input().split())
if a < c < b or b < c < a:
  print("Yes")
else:
  print("No")

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
input = input()
a,b,c = [int(x) for x in input.split()]
if (b-a)*(b-c) < 0:
  print('Yes')
else:
  print('No')

Failing test case input:
-2 -1 2

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
input = input()
a,b,c = [int(x) for x in input.split()]
if (c-a)*(c-b) < 0:
  print('Yes')
else:
  print('No')

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int,input().split())
if c-a>b-a:
  print("Yes")
else:
  print("No")

Failing test case input:
-2 -1 2

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
a,b,c = map(int,input().split())
if a <c<b or b<c<a:
  print("Yes")
else:
  print("No")

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = map(int,input().split())
if a < c < b or a > c > b :
    print('OK')
else :
    print('NO')


Failing test case input:
84 49 0

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
a, b, c = map(int,input().split())
if a > c > b or b > c > a :
  print('Yes')
else :
  print('No')

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
[a, b, c] = list(map(int, input().split(' ')))

print(a, b, c)
if a  <  b and c < b:
    print("Yes")
else:
    print("No")


Failing test case input:
4 8 7

Expected output:
Yes


Actual output:
4 8 7
Yes


Fixed submission (verdict: Accepted):
[a, b, c] = list(map(int, input().split(' ')))

if a  <  c and c < b:
    print("Yes")
elif b < c and c < a:
  	print("Yes")
else:
    print("No")
Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int,input().split())

print("Yes" if (a<c and c<b)  or (b<c and c<a) else "no")


Failing test case input:
-1 -2 2

Expected output:
No


Actual output:
no


Fixed submission (verdict: Accepted):
a,b,c = map(int,input().split())

print("Yes" if (a<c and c<b)  or (b<c and c<a) else "No")

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int,input().split())
print("No" if (a<c and c<b) or (b<c and c<a) else "Yes")

Failing test case input:
0 -2 2

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
a,b,c = map(int,input().split())
print("Yes" if (a<c and c<b) or (b<c and c<a) else "No")

Problem: p03067
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A, B, C = map(int,input().split())
if C > min(A, B) and C < max(A, B):
  print("YES")
else:
  print("NO")

Failing test case input:
51 38 0

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
A, B, C = map(int,input().split())
if C > min(A, B) and C < max(A, B):
  print("Yes")
else:
  print("No")

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = list(map(int,input().split(" ")))

if((a>b and a>c) or (a<b and a<c)):
    print("Yes")
else:
    print("No")

Failing test case input:
-2 -1 2

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
a,b,c = list(map(int,input().split(" ")))

if((a>b and b<c<a) or (a<b and b>c>a)):
    print("Yes")
else:
    print("No")

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C = map(int, input().split())
if B - A >= C:
    print('Yes')
else:
    print('No')


Failing test case input:
3 79 1

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
A, B, C = map(int, input().split())
if A < C < B:
    print('Yes')
elif B < C < A:
    print('Yes')
else:
   print('No')

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C = map(int, input().split())
ans = 'Yes' if min(A, B) <= C <= abs(B-A) else 'No'
print(ans)

Failing test case input:
31 86 59

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
A, B, C = map(int, input().split())
ans = ''
if A<C<B or B<C<A:
    ans = 'Yes'
else:
    ans = 'No'
print(ans)

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int,input().split())

if a<= b <=c:
    print('Yes')
else:
    print('No')

Failing test case input:
31 49 59

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())

if a<= c <=b:
    print('Yes')
elif b<= c <=a:
    print('Yes')
    
else:
    print('No')

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C = map(int, input().split())
ans = 'Yes' if C in list(range(min(A, B), abs(B-A)+1)) else 'No'
print(ans)

Failing test case input:
-4 -1 1

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
A, B, C = map(int, input().split())
ans = ''
if A<C<B or B<C<A:
    ans = 'Yes'
else:
    ans = 'No'
print(ans)
Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B,C=map(int,input().split())
pr='yes'
if (A-B)*(C-B)>=0:
    pr='no'
else:
    pass
print(pr)    


Failing test case input:
51 49 0

Expected output:
No


Actual output:
yes


Fixed submission (verdict: Accepted):
A,B,C=map(int,input().split())
pr='Yes'
if (A-C)*(B-C)>=0:
    pr='No'
else:
    pass
print(pr)

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
*s, t = map(int, input().split())
s.sort()
for i in range(s[0],s[1]):
  if i == t:
    print("Yes")
print("No")

Failing test case input:
31 61 59

Expected output:
Yes


Actual output:
Yes
No


Fixed submission (verdict: Accepted):
*s, t = map(int, input().split())
s.sort()
f = False
for i in range(s[0],s[1]+1):
  if i == t:
    f = True
print("Yes") if f else print("No")

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys

def main():
    argv = input().split()
    A = int(argv[0])
    B = int(argv[1])
    C = int(argv[2])
    print(judge(A, B, C))

def judge(A, B, C):
    if (A < C and A < B) or (C < A and B < A):
        return 'Yes'
    else:
        return 'No'

if __name__ == '__main__':
    main()


Failing test case input:
-4 -1 1

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
import sys

def main():
    argv = input().split()
    A = int(argv[0])
    B = int(argv[1])
    C = int(argv[2])
    print(judge(A, B, C))

def judge(A, B, C):
    if (A < C and C < B) or (C < A and B < C):
        return 'Yes'
    else:
        return 'No'

if __name__ == '__main__':
    main()

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
li = list(map(int, input().split()))
A = li[0]
B = li[1]
C = li[2]

if A < B < C or A > B > C:
  print("Yes")
  
else:
  print("No")

Failing test case input:
4 8 7

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
li = list(map(int, input().split()))
A = li[0]
B = li[1]
C = li[2]
 
if A < C < B or A > C > B:
  print("Yes")
  
else:
  print("No")

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C = map(int, input().split())

if A < C < B:
  print('YES')
elif B < C < A:
  print('YES')
else:
  print('NO')

Failing test case input:
9 1 0

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
A, B, C = map(int, input().split())

if A < C < B:
  print('Yes')
elif B < C < A:
  print('Yes')
else:
  print('No')

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = map(int, input().split())

print("Yes" if b-a >=c else "No")

Failing test case input:
3 8 7

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())

print("Yes" if a <= c <= b  or b <= c <= a else "No")
Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int, input().split())
if a<b and c<b:
  print('Yes')
elif a>b and b<c:
  print('Yes')
else:
  print('No')

Failing test case input:
0 -4 2

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
a,b,c = map(int, input().split())
if a<=c<=b:
  print('Yes')
elif b<=c<=a:
  print('Yes')
else:
  print('No')

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int,input().split())
if b-a>c-a:
  print("Yes")
else:
  print("No")

Failing test case input:
9 0 -1

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
a,b,c = map(int,input().split())
if a <c<b or b<c<a:
  print("Yes")
else:
  print("No")

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = map(int, input().split())
if a <= b and b <= c:
  print("Yes")
elif c <= b and b <= a:
  print("Yes")
else:
  print("No")

Failing test case input:
31 41 75

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())
if a <= c <= b or b <= c <= a:
  print("Yes")
else:
  print("No")

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x,y,z=map(int,input().split())
if x<y:
    if y>z:
        if z>x:
            print("Yes")
    else:
        print("No")
elif x>y:
    if y<z:
        if x>z:
            print("Yes")
    else:
        print("No")


Failing test case input:
-1 -2 3

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
x,y,z=map(int,input().split())
if x<y:
    if y>z:
        if z>x:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
elif x>y:
    if y<z:
        if x>z:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
input = input()
splited = input.split(" ")
a = splited[0]
b = splited[1]
c = splited[2]
if a <= c <= b:
  print("Yes")
else:
  print("No")

Failing test case input:
3 16 5

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
input = input()
splited = input.split(" ")
a = int(splited[0])
b = int(splited[1])
c = int(splited[2])
if a < c < b:
  print("Yes")
elif a > c > b:
  print("Yes")
else:
  print("No")

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
abc=list(map(int,input().split()))
a=abc[0]
b=abc[1]
c=abc[2]
if (b-c)*(a-c)<0:
    print("YES")
else:
    print("NO")


Failing test case input:
31 41 75

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
abc=list(map(int,input().split()))
a=abc[0]
b=abc[1]
c=abc[2]
if (b-c)*(a-c)<0:
    print("Yes")
else:
    print("No")
Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C = map(int, input().split())
if A < B:
    print("Yes" if C < B else "No")
else:
    print("Yes" if B < C else "No")

Failing test case input:
5 6 -1

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
A, B, C = map(int, input().split())

if A < C and C < B:
    print("Yes")
elif B < C and C < A:
    print("Yes")
else:
    print("No")

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
btn=input().split()
if btn[0] < btn[1] and btn[2] < btn[1]:
	print("Yes")
elif btn[0] > btn[1] and btn[2] > btn[1]:
	print("Yes")
else:
	print("No")

Failing test case input:
-4 -1 0

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
btn=input().split()
A=int(btn[0])
B=int(btn[1])
C=int(btn[2])
if A < C < B:
	print("Yes")
elif A > C > B:
	print("Yes")
else:
	print("No")

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

A, B, C = map(int, input().split())
if A < B < C or A > B > C:
    print("No")
else:
    print("Yes")

Failing test case input:
51 86 10

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):

A, B, C = map(int, input().split())
if A < C < B or A > C > B:
    print("Yes")
else:
    print("No")

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

A, B, C = map(int, input().split())
if abs(A - B) > abs(A - C):
    print("Yes")
else:
    print("No")

Failing test case input:
3 79 0

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):

A, B, C = map(int, input().split())
if A < C < B or A > C > B:
    print("Yes")
else:
    print("No")

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = list(map(int,input().split()))
if a[1] > a[0]:
  if a[1] > a[2]:
    print("Yes")
  else:
  	print("No")
else:
  if a[1] < a[2]:
    print("Yes")
  else:
    print("No")

Failing test case input:
9 12 -1

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
a = list(map(int,input().split()))
if a[1] > a[0]:
  if a[1] < a[2] or a[2] < a[0]:
    print("No")
  else:
  	print("Yes")
else:
  if a[1] > a[2] or a[2] > a[0]:
    print("No")
  else:
    print("Yes")

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int,input().split())
if c in list(range(a,b)):
  print('YES')
else:
  print('NO')

Failing test case input:
39 49 59

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
if c in list(range(min(a,b),max(a,b))):
  print('Yes')
else:
  print('No')

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int,input().split())

if a >= c >= b:
	print("Yes")
else:
	print("No")

Failing test case input:
6 8 7

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
a,b,c = map(int,input().split())

if a >= c >= b:
	print("Yes")
elif a <= c <= b:
    print("Yes")
else:
	print("No")
Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int, input().split())  

if c < a and c < b:
    print("No")
if c > b and c > a:
    print("No")
else:
    print("Yes")

Failing test case input:
9 1 -1

Expected output:
No


Actual output:
No
Yes


Fixed submission (verdict: Accepted):
a,b,c = map(int, input().split())  

if c < a and c < b:
    print("No")
elif c > b and c > a:
    print("No")
else:
    print("Yes")

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = map(int, input().split())

p_min = min(a, b)
p_max = max(a, b)
print(p_min, p_max)
if p_min <= c <= p_max:
    print('Yes')
else:
    print('No')


Failing test case input:
51 79 0

Expected output:
No


Actual output:
51 79
No


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())

p_min = min(a, b)
p_max = max(a, b)

if p_min <= c <= p_max:
    print('Yes')
else:
    print('No')

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
input_str = input()
homes = input_str.split(" ")
for home in homes:
    home = int(home)
if ((homes[0] < homes[2] and homes[2] < homes[1]) or (homes[0] > homes[2] and homes[2] > homes[1])):
    print("Yes")
else:
    print("No")


Failing test case input:
3 16 5

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
input_str = input()
homes = input_str.split(" ")
for i, home in enumerate(homes):
    homes[i] = int(home)
if ((homes[2] - homes[1]) * (homes[2] - homes[0]) < 0):
    print("Yes")
else:
    print("No")

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C = map(int, input().split())


if C <= A and C <= B:
    print('Yes')
else:
    print('No')

Failing test case input:
84 49 0

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
A, B, C = map(int, input().split())


if (C >= A and C <= B) or (C >= B and C <= A):
    print('Yes')
else:
    print('No')

Problem: p03067
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, b, c = map(int, input().split())
print('Yes' if a <= c <= b or a >= b >= c else 'No')

Failing test case input:
51 38 0

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())
print('Yes' if a <= c <= b or a >= c >= b else 'No')

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
input=sys.stdin.readline
 
a,b,c=map(int,input().split())
if abs(a-c)<=abs(a-b):
  print("Yes")
else:
  print("No")

Failing test case input:
3 79 -1

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
import sys
input=sys.stdin.readline
 
a,b,c=map(int,input().split())

if (b>=c>=a) or (a>=c>=b):
  print("Yes")
else:
  print("No")
Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = list(map(int,input().split()))
if a[1] > a[0]:
  if a[1] > a[2] or a[2] < a[0]:
    print("No")
  else:
  	print("Yes")
else:
  if a[1] > a[2] or a[2] > a[0]:
    print("No")
  else:
    print("Yes")

Failing test case input:
31 41 75

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
a = list(map(int,input().split()))
if a[1] > a[0]:
  if a[1] < a[2] or a[2] < a[0]:
    print("No")
  else:
  	print("Yes")
else:
  if a[1] > a[2] or a[2] > a[0]:
    print("No")
  else:
    print("Yes")

Problem: p03067
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    A, B, C = map(int, input().split())
    N1 = abs(A - B)
    N2 = abs(C)
    if N2 < N1:
        print("No")
    elif N1 == N2 or N1 < N2:
        print("Yes")
main()


Failing test case input:
-1 -2 3

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
def main():
    A, B, C = map(int, input().split())
    if C < min(A, B) or max(A, B) < C:
        print("No")
    else:
        print("Yes")
main()
Problem: p02813
Buggy submission (Python (3.4.3), verdict: Wrong Answer):







from itertools import permutations





n = int(input())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
m = [i + 1 for i in range(n)]
c = 0
for i in permutations(m):
    c += 1
    print(i)
    if list(i) == p:
        a = c
    if list(i) == q:
        b = c
print(abs(a - b))


Failing test case input:
3
1 3 2
3 1 2

Expected output:
3

Actual output:
(1, 2, 3)
(1, 3, 2)
(2, 1, 3)
(2, 3, 1)
(3, 1, 2)
(3, 2, 1)
3


Fixed submission (verdict: Accepted):







from itertools import permutations





n = int(input())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
m = [i + 1 for i in range(n)]
c = 0

for i in permutations(m):
    c += 1
    
    if list(i) == p:
        a = c
    if list(i) == q:
        b = c

print(abs(a - b))

Problem: p02813
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import itertools
n=int(input())
numbers1k=[]
numbers2k=[]
s=[]
for i in range(n):
    s.append(i+1)
p=itertools.permutations(s,n)
u=list(p)
print(u)
numbers1=input().rstrip().split(" ")
for num1 in numbers1:
    numbers1k.append(int(num1))
numbers2=input().rstrip().split(" ")
for num2 in numbers2:
    numbers2k.append(int(num2))
com1=tuple(numbers1k)
com2=tuple(numbers2k)
for i in range(len(u)):
    if u[i]==com1:
        a=i+1
for j in range(len(u)):
    if u[j]==com2:
        b=j+1


print(abs(b-a))

Failing test case input:
3
1 3 2
3 1 2

Expected output:
3

Actual output:
[(1, 2, 3), (1, 3, 2), (2, 1, 3), (2, 3, 1), (3, 1, 2), (3, 2, 1)]
3


Fixed submission (verdict: Accepted):
import itertools
n=int(input())
numbers1k=[]
numbers2k=[]
s=[]
for i in range(n):
    s.append(i+1)
p=itertools.permutations(s,n)
u=list(p)

numbers1=input().rstrip().split(" ")
for num1 in numbers1:
    numbers1k.append(int(num1))
numbers2=input().rstrip().split(" ")
for num2 in numbers2:
    numbers2k.append(int(num2))
com1=tuple(numbers1k)
com2=tuple(numbers2k)
for i in range(len(u)):
    if u[i]==com1:
        a=i+1
for j in range(len(u)):
    if u[j]==com2:
        b=j+1


print(abs(b-a))

Problem: p02813
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import itertools

N = int(input())
P = [int(a) for a in input().split()]
Q = [int(a) for a in input().split()]
print(P, Q)

listN=list(itertools.permutations(range(1,N+1)))
countP = 0
for i in range(0,len(listN)):
    if list(listN[i])==P:
        break
    else:
        countP+=1



countQ = 0
for j in range(0,len(listN)):
    if list(listN[j])==Q:
        break

    else:
        countQ+=1

print(abs(countP-countQ))


Failing test case input:
3
1 3 2
3 1 2

Expected output:
3

Actual output:
[1, 3, 2] [3, 1, 2]
3


Fixed submission (verdict: Accepted):
import itertools

N = int(input())
P = [int(a) for a in input().split()]
Q = [int(a) for a in input().split()]


listN=list(itertools.permutations(range(1,N+1)))
countP = 0
for i in range(0,len(listN)):
    if list(listN[i])==P:
        break
    else:
        countP+=1



countQ = 0
for j in range(0,len(listN)):
    if list(listN[j])==Q:
        break

    else:
        countQ+=1

print(abs(countP-countQ))
Problem: p02813
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import itertools

N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))

PP = tuple(P)

A = list(itertools.permutations(range(1,N+1)))
PW = (A.index(P))
QW = (A.index(P))

print(abs(PW-QW))


Failing test case input:
3
1 3 2
3 1 2

Expected output:
3

Actual output:
0


Fixed submission (verdict: Accepted):
import itertools

N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))

PP = tuple(P)

A = list(itertools.permutations(range(1,N+1)))
PW = (A.index(P))
QW = (A.index(Q))

print(abs(PW-QW))

Problem: p02813
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import itertools

N = int(input())
P = list(map(int, (input().split())))
Q = list(map(int, (input().split())))

a = 0
b = 0
cnt = 0

tmp = sorted(P)

print(P)

for x in itertools.permutations(tmp):
    cnt += 1

    if P == list(x):
        a = cnt

    if Q == list(x):
        b = cnt

print(abs(a - b))


Failing test case input:
3
1 3 2
3 1 2

Expected output:
3

Actual output:
[1, 3, 2]
3


Fixed submission (verdict: Accepted):
import itertools

N = int(input())
P = list(map(int, (input().split())))
Q = list(map(int, (input().split())))

a = 0
b = 0
cnt = 0

tmp = sorted(P)

for x in itertools.permutations(tmp):
    cnt += 1

    if P == list(x):
        a = cnt

    if Q == list(x):
        b = cnt

print(abs(a - b))

Problem: p02813
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import itertools


n = int(input())



p = input()
q = input()


i = 0
a = 0 
b = 0

for x in itertools.permutations(range(1,n+1), n):
	
	x = " ".join(map(str,x))
	
	i += 1
	if x == p:
		a = i
		print(i)
	elif x == q:
		b = i
		print(i)
        
print(abs(a-b))
     

Failing test case input:
3
1 3 2
3 1 2

Expected output:
3

Actual output:
2
5
3


Fixed submission (verdict: Accepted):
import itertools


n = int(input())




p = input()
q = input()


i = 0



for x in itertools.permutations(range(1,n+1), n):
	
	x = " ".join(map(str,x))
	
	i += 1
	if x == p:
		a = i
		
	if x == q:
		b = i
		

print(abs(a-b))

Problem: p02813
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
def permutationIndex(A):
  if A is None or len(A) ==0:
    return 0
  index = 1
  factor = 1
  for i in range(len(A)-1,-1,-1):
    rank = 0
    for j in range(i+1,len(A)):
      if A[i] > A[j]:
        rank+=1
    index += rank*factor
    factor *= (len(A)-i)
    return index
n = int(input())
p = [int(x) for x in input().split()]
q = [int(x) for x in input().split()]
print(abs(permutationIndex(p)-permutationIndex(q)))

Failing test case input:
3
1 3 2
3 1 2

Expected output:
3

Actual output:
0


Fixed submission (verdict: Accepted):
def permutationIndex(A):
  if A is None or len(A) ==0:
    return 0
  index = 1
  factor = 1
  for i in range(len(A)-1,-1,-1):
    rank = 0
    for j in range(i+1,len(A)):
      if A[i] > A[j]:
        rank+=1
    index += rank*factor
    factor *= (len(A)-i)
  return index
n = int(input())
p = [int(x) for x in input().split()]
q = [int(x) for x in input().split()]
print(abs(permutationIndex(p)-permutationIndex(q)))
Problem: p02813
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import itertools

n = int(input())
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))

index = []

for i, s in enumerate(itertools.permutations(range(1, n+1),n)):
    if s == p or s == q:
        index.append(i)

print(len(index))

if len(index) == 2:
    print(abs(index[0]-index[1]))
else:
    print('0')




Failing test case input:
3
1 3 2
3 1 2

Expected output:
3

Actual output:
2
3


Fixed submission (verdict: Accepted):
import itertools

n = int(input())
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))

index = []

for i, s in enumerate(itertools.permutations(range(1, n+1),n)):
    if s == p or s == q:
        index.append(i)


if len(index) == 2:
    print(abs(index[0]-index[1]))
else:
    print('0')

Problem: p02813
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import itertools

N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))


pos = 0
pos_p = 0
pos_q = 0
for i in itertools.permutations(range(1,N)):
    pos += 1
    if i == P:
        pos_p = pos
    if i == Q:
        pos_q = pos

print(abs(pos_p - pos_q))



Failing test case input:
3
1 3 2
3 1 2

Expected output:
3

Actual output:
0


Fixed submission (verdict: Accepted):
import itertools

N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))


pos = 0
pos_p = 0
pos_q = 0
for i in itertools.permutations(range(1,N + 1)):
    pos += 1
    if i == P:
        pos_p = pos
    if i == Q:
        pos_q = pos

print(abs(pos_p - pos_q))

Problem: p02813
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import itertools

N = int(input())
P = [int(x) for x in input().split()]
P = tuple(P)
Q = [int(x) for x in input().split()]
Q = tuple(Q)
N_ = list(range(1, N+1))

R = list(itertools.permutations(N_))

Pflg = Qflg = False
Pcnt = Qcnt = -1
for i, r in enumerate(R):
    print(r)
    if P==r:
        Pflg = True
        Pcnt = i
    if Q==r:
        Qflg = True
        Qcnt = i
    if Pflg and Qflg:
        break

print(abs(Pcnt - Qcnt))

Failing test case input:
3
1 3 2
3 1 2

Expected output:
3

Actual output:
(1, 2, 3)
(1, 3, 2)
(2, 1, 3)
(2, 3, 1)
(3, 1, 2)
3


Fixed submission (verdict: Accepted):
import itertools

N = int(input())
P = [int(x) for x in input().split()]
P = tuple(P)
Q = [int(x) for x in input().split()]
Q = tuple(Q)
N_ = list(range(1, N+1))

R = list(itertools.permutations(N_))

Pflg = Qflg = False
Pcnt = Qcnt = -1
for i, r in enumerate(R):
    if P==r:
        Pflg = True
        Pcnt = i
    if Q==r:
        Qflg = True
        Qcnt = i
    if Pflg and Qflg:
        break

print(abs(Pcnt - Qcnt))
Problem: p02813
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

n=int(input())
p=list(map(int,input().split()))
q=list(map(int,input().split()))


p_n=0
q_n=0
for i in range(n):
    count_p=p[i]-1
    count_q=q[i]-1
    for j in range(i):
        if p[j]<p[i]:
            count_p-=1
        if q[j]<q[i]:
            count_q-=1
    p_n+=math.factorial(n-i-1)*count_p
    q_n+=math.factorial(n-i-1)*count_q

print(p_n-q_n)

Failing test case input:
3
1 3 2
3 1 2

Expected output:
3

Actual output:
-3


Fixed submission (verdict: Accepted):
import math

n=int(input())
p=list(map(int,input().split()))
q=list(map(int,input().split()))


p_n=0
q_n=0
for i in range(n):
    count_p=p[i]-1
    count_q=q[i]-1
    for j in range(i):
        if p[j]<p[i]:
            count_p-=1
        if q[j]<q[i]:
            count_q-=1
    p_n+=math.factorial(n-i-1)*count_p
    q_n+=math.factorial(n-i-1)*count_q

print(abs(p_n-q_n))

Problem: p02813
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import itertools

N = int(input())

permu = [i+1 for i in range(N)]
s = 0
flag = False

P = tuple([int(i) for i in input().split(" ")])
Q = tuple([int(i) for i in input().split(" ")])

print(P)
for i, value in enumerate(itertools.permutations(permu)):
    

    if value == P or value == Q:
        
        if flag:
            s -= i
        else:
            s += i
            flag = True

print(abs(s))


Failing test case input:
3
1 3 2
3 1 2

Expected output:
3

Actual output:
(1, 3, 2)
3


Fixed submission (verdict: Accepted):
import itertools

N = int(input())

permu = [i+1 for i in range(N)]
s = 0
flag = False

P = tuple([int(i) for i in input().split(" ")])
Q = tuple([int(i) for i in input().split(" ")])

if P==Q:
    print(s)
else:
    for i, value in enumerate(itertools.permutations(permu)):

        if value == P or value == Q:
            
            if flag:
                s -= i
                break
            else:
                s += i
                flag = True

    print(abs(s))

Problem: p02813
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import itertools
 
N = int(input())
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))

a = 0
b = 0
for i, x in  enumerate(itertools.permutations(range(1, N + 1))):
    print(i, x)
    if x == p:
        a = i
    if x == q:
        b = i
print(abs(a - b))

Failing test case input:
3
1 3 2
3 1 2

Expected output:
3

Actual output:
0 (1, 2, 3)
1 (1, 3, 2)
2 (2, 1, 3)
3 (2, 3, 1)
4 (3, 1, 2)
5 (3, 2, 1)
3


Fixed submission (verdict: Accepted):
import itertools
 
N = int(input())
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))

a = 0
b = 0
for i, x in  enumerate(itertools.permutations(range(1, N + 1))):
    
    if x == p:
        a = i
    if x == q:
        b = i
print(abs(a - b))
Problem: p02813
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import itertools
n=int(input())
p=tuple(map(int, input().split()))
q=tuple(map(int, input().split()))
print(n, p, q)

for i, v in enumerate(itertools.permutations(range(1,n+1))):
    if p==v:
        s=i
    if q==v:
        t=i
print(abs(s-t))

Failing test case input:
3
1 3 2
3 1 2

Expected output:
3

Actual output:
3 (1, 3, 2) (3, 1, 2)
3


Fixed submission (verdict: Accepted):
import itertools
n=int(input())
p=tuple(map(int, input().split()))
q=tuple(map(int, input().split()))

for i, v in enumerate(itertools.permutations(range(1,n+1))):
    if p==v:
        s=i
    if q==v:
        t=i
print(abs(s-t))

Problem: p02813
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from itertools import permutations

n = int(input())
p = tuple(map(int,input().split()))
q = tuple(map(int,input().split()))
if p == q:
    print(0)
    exit()
base = sorted(p)
pi = 0
qi = 0
for i, v in enumerate(permutations(base, n)):
    print(v)
    if p == v:
        pi = i + 1
    elif q == v:
        qi = i + 1
        
    if pi * qi != 0:
        break
print(abs(pi-qi))


Failing test case input:
3
1 3 2
3 1 2

Expected output:
3

Actual output:
(1, 2, 3)
(1, 3, 2)
(2, 1, 3)
(2, 3, 1)
(3, 1, 2)
3


Fixed submission (verdict: Accepted):
from itertools import permutations

n = int(input())
p = tuple(map(int,input().split()))
q = tuple(map(int,input().split()))
if p == q:
    print(0)
    exit()
base = sorted(p)
pi = 0
qi = 0
for i, v in enumerate(permutations(base, n)):
    if p == v:
        pi = i + 1
    elif q == v:
        qi = i + 1
        
    if pi * qi != 0:
        break

print(abs(pi-qi))

Problem: p02813
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import itertools

if __name__ == '__main__':
    
    
    
    n = int(input())
    p = input().split(' ')
    q = input().split(' ')

    for i in range(0, len(q)):
        p[i] = int(p[i])
        q[i] = int(q[i])

    perm = list(itertools.permutations(p))

    it = 0

    qplace = 0
    pplace = 0

    for i in perm:
        it += 1
        if list(i) == q:
            qplace = it
        if list(i) == p:
            pplace = it
    print(abs(pplace - qplace))

Failing test case input:
3
1 3 2
3 1 2

Expected output:
3

Actual output:
2


Fixed submission (verdict: Accepted):
import itertools

if __name__ == '__main__':
    
    
    
    n = int(input())
    p = input().split(' ')
    q = input().split(' ')

    for i in range(0, len(q)):
        p[i] = int(p[i])
        q[i] = int(q[i])

    realnums = p.copy()

    realnums.sort()

    perm = list(itertools.permutations(realnums))

    it = 0

    qplace = 0
    pplace = 0

    for i in perm:
        if list(i) == q:
            qplace = it
        if list(i) == p:
            pplace = it
        it += 1
    print(abs(qplace - pplace))
Problem: p02813
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import itertools

n = int(input())
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))

index = []

for i, s in enumerate(itertools.permutations(range(1, n+1),n)):
    if s == p or s == q:
        index.append(i)

if not index:
    print(abs(index[0]-index[1]))
else:
    print('0')




Failing test case input:
3
1 3 2
3 1 2

Expected output:
3

Actual output:
0


Fixed submission (verdict: Accepted):
import itertools

n = int(input())
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))

index = []

for i, s in enumerate(itertools.permutations(range(1, n+1),n)):
    if s == p or s == q:
        index.append(i)


if len(index) == 2:
    print(abs(index[0]-index[1]))
else:
    print('0')

Problem: p02813
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math


N = int(input())
list1 = list(map(int, input().split()))
list2 = list(map(int, input().split()))

def CO(l):
    n = len(l)
    if n != 1:
        m = sorted(l)
        a = l[0]
        s = m.index(a)
        l.remove(a)
        return((s)*math.factorial(n-1)+CO(l))
    else:
        return 1

print(abs(CO(list1)+CO(list2)))


Failing test case input:
3
1 3 2
3 1 2

Expected output:
3

Actual output:
7


Fixed submission (verdict: Accepted):
import math


N = int(input())
list1 = list(map(int, input().split()))
list2 = list(map(int, input().split()))

def CO(l):
    n = len(l)
    if n != 1:
        m = sorted(l)
        a = l[0]
        s = m.index(a)
        l.remove(a)
        return((s)*math.factorial(n-1)+CO(l))
    else:
        return 1

print(abs(CO(list1)-CO(list2)))

Problem: p02813
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import itertools
n=int(input())
l=list(itertools.permutations(range(1,n+1),n))

a=tuple(map(int,input().split()))
b=tuple(map(int,input().split()))
a_index=0
b_index=0

for i in range(len(l)):
    print(l[i])
    if l[i]==a:
        a_index=i+1
    elif l[i]==b:
        b_index=i+1
    else:
        continue

result=abs(a_index-b_index)
print(result)

Failing test case input:
3
1 3 2
3 1 2

Expected output:
3

Actual output:
(1, 2, 3)
(1, 3, 2)
(2, 1, 3)
(2, 3, 1)
(3, 1, 2)
(3, 2, 1)
3


Fixed submission (verdict: Accepted):
import itertools
n=int(input())
l=list(itertools.permutations(range(1,n+1),n))

a=tuple(map(int,input().split()))
b=tuple(map(int,input().split()))
a_index=0
b_index=0

for i in range(len(l)):
    if l[i]==a:
        a_index=i+1
    elif l[i]==b:
        b_index=i+1
    else:
        continue
if a_index==0 or b_index==0:
    print(0)
else:    
    result=abs(a_index-b_index)
    print(result)
Problem: p02813
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from math import factorial
from itertools import permutations

n = int(input())
p = tuple(map(str, input().split()))
q = tuple(map(str, input().split()))

num = [str(i) for i in range(1, n+1)]

allnum = list(i for i in permutations(num, n))

print(allnum)
print(abs(allnum.index(p) - allnum.index(q)))

Failing test case input:
3
1 3 2
3 1 2

Expected output:
3

Actual output:
[('1', '2', '3'), ('1', '3', '2'), ('2', '1', '3'), ('2', '3', '1'), ('3', '1', '2'), ('3', '2', '1')]
3


Fixed submission (verdict: Accepted):
from math import factorial
from itertools import permutations

n = int(input())
p = tuple(map(str, input().split()))
q = tuple(map(str, input().split()))

num = [str(i) for i in range(1, n+1)]

allnum = list(i for i in permutations(num, n))

print(abs(allnum.index(p) - allnum.index(q)))

Problem: p02813
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import itertools

n = int(input())
p = map(int, input().split())
q = map(int, input().split())

x = itertools.permutations(list(range(1, n+1)), n)
pnum = 0
qnum = 0
for index, xx in enumerate(x):
  if(list(xx) == p):
    pnum = index + 1
  if(list(xx) == q):
    qnum = index + 1
    
print(abs(pnum - qnum))


Failing test case input:
3
1 3 2
3 1 2

Expected output:
3

Actual output:
0


Fixed submission (verdict: Accepted):
import itertools

n = int(input())
p = list(map(int, input().split()))
q = list(map(int, input().split()))

x = itertools.permutations(list(range(1, n+1)), n)
pnum = 0
qnum = 0
for index, xx in enumerate(x):
  if(list(xx) == p):
    pnum = index
  if(list(xx) == q):
    qnum = index
    
print(abs(pnum - qnum))

Problem: p02813
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
import itertools

n = int(input())
p_list = list(map(int, input().split()))
q_list = list(map(int, input().split()))
num_list = []
num = 0
a = 0
b = 0

for i in itertools.permutations(range(1,n+1)):
    num_list = list(i)
    num += 1
    if num_list == p_list:
        a = num
    if num_list == q_list:
        b = num

print(math.fabs(a-b))

Failing test case input:
3
1 3 2
3 1 2

Expected output:
3

Actual output:
3.0


Fixed submission (verdict: Accepted):
import itertools

n = int(input())
p_list = list(map(int, input().split()))
q_list = list(map(int, input().split()))
num_list = []
num = 0
a = 0
b = 0

for i in itertools.permutations(range(1,n+1)):
    num_list = list(i)
    num += 1
    if num_list == p_list:
        a = num
    if num_list == q_list:
        b = num

print(abs(a-b))