Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03309 (python)

Fixed submission:
N = int(input())
AS = input().split()
AS = [int(i) for i in AS]
BS = [int(AS[j-1] - j) for j in range(1,N+1)]
BS_s = BS.sort()
b = BS[N//2]
result_a = 0
result_b = 0
result_c = 0
for j in range (1, N+1):
    result_a += abs(int(AS[j-1]) - b - j)
for j in range (1, N+1):
    result_b += abs(int(AS[j-1]) - b - 1 - j)
for j in range (1, N+1):
    result_c += abs(int(AS[j-1]) - b + 1 - j)
print (int(min(result_a,result_b,result_c)))

Buggy submission (verdict: Runtime Error):
import statistics
import math
N = int(input())
AS = input().split()
AS = [int(i) for i in AS]
BS = [int(AS[j-1] - j) for  i in range(1,N+1)]
b = int('{0:8.0f}'.format(statistics.median(BS)))
result_a = 0
result_b = 0
result_c = 0
for j in range (1, N+1):
    result_a += abs(int(AS[j-1]) - b - j)
for j in range (1, N+1):
    result_b += abs(int(AS[j-1]) - b - 1 - j)
for j in range (1, N+1):
    result_c += abs(int(AS[j-1]) - b + 1 - j)
print (int(min(result_a,result_b,result_c)))

Buggy submission (verdict: Runtime Error):
import statistics
import math
N = int(input())
AS = input().split()
AS = [int(i) for i in AS]
BS = [int(AS[j-1] - j) for  i in range(1,N+1)]
b = int('{0:8.0f}'.format(statistics.median(BS)))
result_a = 0
result_b = 0
result_c = 0
for j in range (1, N+1):
    result_a += abs(int(AS[j-1]) - b - j)
for j in range (1, N+1):
    result_b += abs(int(AS[j-1]) - b - 1 - j)
for j in range (1, N+1):
    result_c += abs(int(AS[j-1]) - b + 1 - j)
print (min(result_a,result_b,result_c))
Problem p03337 (python)

Fixed submission:
A, B = map(int, input().split())
print (max(A + B, A - B, A * B))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = list(input()) 
result_list = []
for i in range(N):    
    result_list.append(S[:i].count("W") + S[i+1:].count("E"))
print(min(result_list))
Problem p03338 (python)

Fixed submission:
N = int(input())
S = list(input()) 
result_list = [] 
for i in range(N): 
    X = S[:i] 
    Y = S[i:] 
    counter = 0 
    old_list = [] 
    for j in X: 
        if j in Y and not(j in old_list): 
            counter += 1 
            old_list.append(j) 
            result_list.append(counter) 
if result_list == []:
    print(0)
else:
    print (max(result_list))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = list(input()) 
result_list = [] 
for i in range(N): 
    X = S[:i] 
    Y = S[i:] 
    counter = 0 
    old_list = [] 
    for j in X: 
        if j in Y and not(j in old_list): 
            counter += 1 
            old_list.append(j) 
            result_list.append(counter) 
print (max(result_list))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = list(map(int,input().split(""))) 
result_list = [] 
for i in range(N): 
    X = S[:i] 
    Y = S[i:] 
    counter = 0 
    old_list = [] 
    for j in X: 
        if j in Y and not(j in old_list): 
            counter += 1 
            old_list.append(j) 
            result_list.append(counter) 
print (max(result_list))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = list(map(int,input().split())) 
result_list = [] 
for i in range(N): 
    X = S[:i] 
    Y = S[i:] 
    counter = 0 
    old_list = [] 
    for j in X: 
        if j in Y and not(j in old_list): 
            counter += 1 
            old_list.append(j) 
            result_list.append(counter) 
print (max(result_list))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = list(map(int,input().split())) 
result_list = [] 
for i in range(N): 
    X = S[:i] 
    Y = S[i:] 
    counter = 0 
    old_list = [] 
    for j in X: 
        if j in Y and not(j in old_list): 
            counter += 1 old_list.append(j) 
            result_list.append(counter) 
print(max(result_list))
Problem p03597 (python)

Fixed submission:
N = int(input())
A = int(input())
print(N**2-A)

Buggy submission (verdict: Runtime Error):
A,B,C,D,E,F= map(int, input().split())
res_dict = {}
x_list = []
for i in range(F // A + 1):
    for j in range((F - 100 * A * i) // B + 1):
        x = 100 * (i * A + j * B)
        if x <= F:
            x_list.append(x)
x_uniq = list(set(x_list))
for x in x_uniq:
    for i in range((F - x) // C + 1):
        for j in range((F - x - C * i ) // D + 1):
            y = i * C + j * D
            if x + y <= F and x + y != 0 and x != 0 and ((y / (x + y) <= (E / (100 + E)))):
                res_dict[x] = y
res_dict2 = {}
for i in res_dict:
    res_dict2[res_dict[i]/i] = i
print(res_dict)
print("{0} {1}".format(int(((1 + max(res_dict2))*res_dict2[max(res_dict2)])),int(max(res_dict2)*res_dict2[max(res_dict2)])))
Problem p03759 (python)

Fixed submission:
a,b,c = map(int,input().split())
if b-a == c-b:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if b-a == c-b:
    print("YES")
else:
    pritn("NO")
Problem p03845 (python)

Fixed submission:
N = int(input())
Ts = input().split()
Ts = [int(i) for i in Ts]
Tsum = sum(Ts)
M = int(input())
res_list = []
for i in range(M):
    P,X = map(int,input().split())
    res = Tsum - Ts[P-1] + X
    print(res)

Buggy submission (verdict: Runtime Error):
N = int(input())
Ts = input().split()
Ts = [int(i) for i in Ts]
Tsum = sum(Ts)
M = int(input())
res_list = []
for i in range(M):
    P,X = map(int,input().split())
    res = Tsum - Ts[i] + X
    res_list.append(res)
for i in res_list:
    print(i)

Buggy submission (verdict: Runtime Error):
N = int(input())
Ts = input().split()
Ts = [int(i) for i in Ts]
Tsum = sum(Ts)
M = int(input())
for i in range(M):
    P,X = map(int,input().split())
    res = Tsum - Ts[i] + X
    print(res)
Problem p04044 (python)

Fixed submission:
N, L = map(int, input().split())
S = [input() for i in range(N)]
for i in range(N):
    print(sorted(S)[i], end="")

Buggy submission (verdict: Runtime Error):
N, L = map(int, input().split())
S = [input() for i in range(N)]
for i in range(3):
    print(sorted(S)[i], end="")

Buggy submission (verdict: Runtime Error):
N, L = map(int, input().split())
S = [input() for i in range(N)]
print("{0}{1}{2}".format(sorted(S)[0],sorted(S)[1],sorted(S)[2]))
Problem p02898 (python)

Fixed submission:
N, K = map(int,input().split())
h = list(map(int,input().split()))
count = 0
for i in range(N):
  if K <= h[i]:
    count = count + 1
  else:
    continue
    
print(count)

Buggy submission (verdict: Runtime Error):
N, K = map(int,input().split())
h = map(int,input().split())
count = 0
for i in range(N):
  if K <= h[i]:
    count = count + 1
  else:
    continue
    
print(count)
Problem p02899 (python)

Fixed submission:
#sort
N = int(input())
A = list(map(int, input().split()))
attend_list = [0]*N
 
for i in range(N):
  attend_list[int(A[i]-1)] = int(i+1) 

print(*attend_list)

Buggy submission (verdict: Runtime Error):
#sort
N = int(input())
A = list(map(int, input().split()))
attend_list = []
 
for i in range(N):
  attend_list[int(A[i]-1)] = int(i+1) 
 
print(attend_list)

Buggy submission (verdict: Runtime Error):
#sort
N = int(input())
A = list(map(int, input().split()))
attend_list = []

for i in range(N):
  attend_list[A[i]-1] = i+1 

print(attend_list)
Problem p03035 (python)

Fixed submission:
a,b = map(int, input().split())
 
if a > 12:
  print(b)
elif a >5:
  print(int(b/2))
else:
  print(0)

Buggy submission (verdict: Runtime Error):
a,b = input().split()

if a > 12:
  print(b)
elif a > 5:
  print(b/2)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
a = input().split()

if a[0] > 12:
  print(a[1])
else if a[0] > 6:
  print(a[1]/2)
else:
  print(0)
Problem p03037 (python)

Fixed submission:
N, M = map(int, input().split())
List_LR = [list(map(int,input().split())) for i in range(M)]
L = [List_LR[i][0] for i in range(len(List_LR))]
R = [List_LR[i][1] for i in range(len(List_LR))]
 
L_max = max(L)
R_min = min(R)

ans = R_min - L_max +1
if ans < 0 : ans = 0
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split)
List_LR = [list(map(int,input().split())) for i in range(M)]
L = [List_LR[i][0] for i in range(len(List_LR))]
R = [List_LR[i][1] for i in range(len(List_LR))]

L_max = max(L)
R_min = min(R)

ans = R_min - L_max +1
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split)
List = [list(map(int,input().split())) for i in range(M)]

count = 0
for i in range(N):
  if i+1 >= List[i][0] & i+1 <= List[i][1]:
    count = count + 1

print(count)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split)
List = [map(int,input().split()) for i in range(M)]
count = 0

for i in range(N):
  if i+1 >= List[2*i] & i+1 <= List[2*i+1]:
    count = count + 1
print(count)

Buggy submission (verdict: Runtime Error):
N, M = int(int, input().split)
List = [map(int,input().split()) for i in range(M)]
count = 0
for i in range(N):
  if i+1 >= List[2*i] & i+1 <= List[2*i+1]:
    count = count + 1
  else:
    continue

print(count)
Problem p03455 (python)

Fixed submission:
a,b=map(int,input().split())
if (a*b)%2==0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
a,b,c=map(int, input().split())
if (a*b)%2==0:
  print('Even')
esle:
  print('0dd')

Buggy submission (verdict: Runtime Error):
a,b,c=map(int, input().split())
if (a*b)%2==0:
  print('Even')
esle:
  print('odd')

Buggy submission (verdict: Runtime Error):
a,b,c=map(int, input().split())
if (a*b)%2==0:
  print('Even')
  esle:
    print('odd')
Problem p02909 (python)

Fixed submission:
import sys

status = input()
out = ["Sunny", "Cloudy", "Rainy"]

if status==out[0]:
	print(out[1])
elif status==out[1]:
	print(out[2])
elif status==out[2]:
	print(out[0])

Buggy submission (verdict: Runtime Error):
import sys

status = input()
out = {"Sunny", "Cloudy", "Rainy"}

if status==out[0]:
	print(out[1])
elif status==out[1]:
	print(out[2])
elif status==out[2]:
	print(out[0])

Buggy submission (verdict: Runtime Error):
import sys

status = input()
out = {"Sunny", "Cloudy", "Rainy"}

if(status==out[0])
	print(out[1])
elif(status==out[1])
	print(out[2])
elif(status==out[2])
	print(out[0])
Problem p03456 (python)

Fixed submission:
import numpy as np

a, b = input().split()
a = a+b

if np.sqrt(int(a)).is_integer():
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
import numpy in np

a, b = input().split()
a = a+b

if np.sqrt(int(a)).is_integer():
	print("Yes")
else:
	print("No")
Problem p03069 (python)

Fixed submission:
N = int(input())
S = input()

b = 0
w = S.count(".")
ans = w

for i in range(N):
    if S[i] == ".":
        w -= 1
    else:
        b += 1
    ans = min(ans, b + w)

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
count = 0

for i in range(N):
    if S[i] == "#" and S[i+1] == ".":
        break

for j in range(i+1, N):
    if S[j] == ".":
        count += 1

print(count)
Problem p03071 (python)

Fixed submission:
A, B = list(map(int, input().split()))
result = 0
A, B = max(A, B), min(A, B)
result += A + max(A-1, B)
print(result)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
result = 1

for i in range(N):
    dec = True
    for j in range(i-1):
        if H[i] <= H[j]:
            dec = False
            break
    if dec == True:
        result += 1
print(result)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
result = 0

for i in range(N):
    dec = True
    for j in range(i-1):
        if H[i] <= H[j]:
            dec = False
            break
    if dec == True:
        result += 1
print(result)
Problem p03455 (python)

Fixed submission:
a, b = map(int,input().split())
r = a * b
if (r % 2 == 0):
  print("Even");
else:
  print("Odd");

Buggy submission (verdict: Runtime Error):
a, b = int(input().split())
r = a * b
if (r % 2 == 0):
  print("Even");
else:
  print("Odd");

Buggy submission (verdict: Runtime Error):
a, b = int(input().split());
r = a * b;
if (r % 2 == 0):
  print("Even");
else:
  print("Odd");

Buggy submission (verdict: Runtime Error):
a, b = int(input().split());
r = a * b;
if (r % 2 == 0):
  print(Even);
else:
  print(Odd);

Buggy submission (verdict: Runtime Error):
a, b = int(input());
r = a * b;
if (r % 2):
  print(Even);
else:
  print(Odd);

Buggy submission (verdict: Runtime Error):
a, b = int(input());
r = a * b;
if (r % 2):
  print(Odd);
else:
  print(Even);
Problem p03457 (python)

Fixed submission:
import sys
lis =list()
lis.append([0, 0, 0])
sys.stdin.readline()
for e in sys.stdin:
  lis.append(list(map(int, e.split())))
for i in range(len(lis) - 1):
  d_t = lis[i + 1][0] - lis[i][0]
  man_dis = abs(lis[i + 1][1] - lis[i][1]) + abs(lis[i + 1][2] - lis[i][2])
  if d_t < man_dis or d_t % 2 - man_dis % 2 != 0:
    print("No")
    sys.exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
import sys
lis =list()
lis.append([0, 0, 0])
sys.stdin.readline()
for e in sys.stdin:
  lis.append(list(map(int, input().split())))
for i in range(len(lis) - 1):
  d_t = lis[i + 1][0] - lis[i][0]
  man_dis = abs(lis[i + 1][1] - lis[i][1]) + abs(lis[i + 1][2] - lis[i][2])
  if d_t < man_dis or d_t % 2 - man_dis % 2 != 0:
    print("No")
    sys.exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
import sys
lis =list()
lis.append([0, 0, 0])
for e in sys.stdin:
  lis.append(list(map(int, input().split())))
for i in range(len(lis) - 1):
  d_t = lis[i + 1][0] - lis[i][0]
  man_dis = abs(lis[i + 1][1] - lis[i][1]) + abs(lis[i + 1][2] - lis[i][2])
  if d_t < man_dis or d_t % 2 - man_dis % 2 != 0:
    print("No")
    sys.exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
import math
import sys
row=int(input())
lis=[list(map(int,input().split())) for i in range(row)]
for i in range(len(lis) - 1):
  d_t = lis[i + 1, 0] - lis[i, 0]
  man_dis = math.abs(lis[i + 1, 1] - lis[i, 1]) + math.abs(lis[i + 1, 2] - lis[i, 2])
  if d_t < man_dis or d_t % 2 - man_dis % 2 != 0:
    print("No")
    sys.exit()
print("Yes")
Problem p04031 (python)

Fixed submission:
import numpy as np
import math
N = int(input())

a = np.array(list(map(int, input().split())))

c = round(a.mean())

res = int(0)

for i in a:
    res += (c - i) ** 2

print(int(res))

Buggy submission (verdict: Runtime Error):
import numpy as np
import math
N = int(input())

a = np.array(list(map(int, input().split())))

c = round(a.mean())

res = int(0)

for i in a:
    res += (c - i) ** 2

print(int(res))
Problem p02898 (python)

Fixed submission:
n, k = map(int, input().split())
h = list(map(int,input().split()))
oppai = 0
for i in range (n):
  if h[i] >= k:
    oppai += 1
print(oppai)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = list(map(int,input().split()))
oppai = 0
for i in range n:
  if h[i] >= k:
    oppai += 1
print(oppai)
Problem p02909 (python)

Fixed submission:
s = input()
if s == "Sunny":
  print("Cloudy")
elif s == "Cloudy":
  print("Rainy")
else:
  print("Sunny")

Buggy submission (verdict: Runtime Error):
S = list(input())
for i in range(len(S)):
  if i % 2 == 0:
   	if S[i] == ("R" or "U" or "D"):
    	continue
   	else:
    	print("No")
      	exit()
  else:
  	if S[i] == ("L" or "U" or "D"):
    	continue
    else:
    	print("No")
      	exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
S = list(input())
for i in range(len(S)):
  if i % 2 == 0:
   	if S[i] == ("R" or "U" or "D"):
    	continue
   	else:
    	print("No")
      	exit()
  else:
    if S[i] == ("L" or "U" or "D"):
    	continue
    else:
    	print("No")
      	exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
S = list(input())
for i in range(len(S)):
  if i % 2 == 0:
   	if S[i] == ("R" or "U" or "D"):
      continue
   	else:
      print("No")
      exit()
  else:
    if S[i] == ("L" or "U" or "D"):
      continue
    else:
      print("No")
      exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
if input() == "Sunny":
  print("Cloudy")
elif input() == "Cloudy":
  print("Rainy")
elif input() == "Rainy":
  print("Sunny")

Buggy submission (verdict: Runtime Error):
if input() == "Sunny":
  print("Cloudy")
elif input() == "Cloudy":
  print("Rainy")
else:
  print("Sunny")

Buggy submission (verdict: Runtime Error):
if input() == "Sunny":
  print("Cloudy")
if input() == "Cloudy":
  print("Rainy")
if input() == "Rainy":
  print("Sunny")

Buggy submission (verdict: Runtime Error):
if input() == "Sunny":
  print("Cloudy")
elif input() == "Cloudy":
  print("Rainy")
else:
  print("Sunny")

Buggy submission (verdict: Runtime Error):
if input() == "Sunny":
  print("Cloudy")
elif input() == "Cloudy":
  print("Rainy")
elif input() =="Rainy":
  print("Sunny")

Buggy submission (verdict: Runtime Error):
if input() == "Sunny":
  print("Cloudy")
elif input() == "Cloudy":
  print("Rainy")
else:
  print("Sunny")
Problem p02922 (python)

Fixed submission:
a,b = map(int, input().split())
tap = a
i = 0
if b != 1:
	while tap < b:
		tap = tap + a-1
		i += 1
	print(i + 1)
else:
  	print(0)

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
tap = a
i = 1
while tap < b:
	tap = tap + a-1
	i += 1
return i

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
tap = a
i = 1
while tap < b:
	tap = tap + a-1
	i += 1
return (i)

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
tap = a
while tap < b:
  tap = tap + a-1
return (i + 1)

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
tap = a
for i in range(n):
  tap = tap + a-1
  if tap >= b:
    print(i + 1)
    break
Problem p02981 (python)

Fixed submission:
N, A, B = map(int, input().split())
print(min(A * N, B))

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
print(min(A * B, C))
Problem p03029 (python)

Fixed submission:
A, P = map(int, input().split())
print((A * 3 + P)//2)

Buggy submission (verdict: Runtime Error):
A, P = map(int, input().input())
print((A * 3 + P)//2)
Problem p03035 (python)

Fixed submission:
A, B = map(int, input().split())
if A>=13:
  print(B)
elif 6 <= A <= 12:
  print(B//2)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().sp;it())
if A>=13:
  print(B)
elif 6 <= A <= 12:
  print(B//2)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().sp;it())
if A>=13:
  print(B)
elif 6 <= A <= 12:
  print(B/2)
else:
  print(0)
Problem p03493 (python)

Fixed submission:
print(input().count("1"))

Buggy submission (verdict: Runtime Error):
n = input()
a = list(map(int, input().split()))
cnt = 0
while all(i%2 == 0 for i in a):
    a = [i % 2 for i in  a]
    cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
n = input()
a = list(map(int, input().split()))
cnt = 0
while all(i%2 == 0 for i in a):
    a = [i % 2 for i in  a]
    cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
print(input(),count("1"))
Problem p02922 (python)

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

x,cnt =1,0

while(x<B):
  x +=A-1
  cnt +=1

print(cnt)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())

x,cnt =1,0

while(x<B):
  x +=A-1
  cnt +=1

print(cnt)
Problem p02952 (python)

Fixed submission:
N =int(input())
oppai=0

for i in range(1,N+1):
  if len(str(i))%2 == 1:
    oppai +=1

print(oppai)

Buggy submission (verdict: Runtime Error):
N =int(input())
oppai=0

for i in range(1,N):
  if len(str(i))%2=1:
    oppai +=1

print(oppai)
Problem p02957 (python)

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

if (B%2!=A%2):
  print("IMPOSSIBLE")
  
else:
  print((B+A)//2)

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split())

if B%2!=A%2
  print("IMPOSSIBLE")
  
else:
  print((B-A)//2)

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split())
N=0

if(B-A)%2=1:
  print("IMPOSSIBLE")
  
else:
  print((B-A)//2)

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split())


if(B-A)%2=1:
  print("IMPOSSIBLE")
  
else:
  print((B-A)//2)

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split())


if (B-A)%2=1:
  print("IMPOSSIBLE")
  
else:
  print((B-A)/2)

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split())


if (A+B)%2=1:
  print(IMPOSSIBLE)
  
else:
  print((A+B)/2)
Problem p02958 (python)

Fixed submission:
N = int(input())
p = list(map(int,input().split()))

o=1
e=0
for i in p:
  if i != o:
    e +=1
  o +=1
if e==0 or e==2:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
N = int(input())
p = list(map(int,input().split()))

o=1
e=0
for i in p:
  if i != o:
    e +=1
  o +=1
if e=0 or e=2:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
N = int(input())
p = list(map(int,input().split()))

o=1
e=0
for i in range(N):
  if i != o:
    o +=1
    e  +=1

if e=0 or e=2:
  print(YES)
else:
  print(NO)
Problem p02988 (python)

Fixed submission:
n = int(input())
p = list(map(int,input().split()))
m=0

for i in range(1,n-1):
  if (p[i-1]<p[i]<p[i+1]) or (p[i-1]>p[i]>p[i+1]):
    m +=1
  else:
    m +=0

    
print(m)

Buggy submission (verdict: Runtime Error):
n = int(input())
p = list(map(int,input().split()))
m=0

for i in range(2,n):
  if (p[i-1]<p[i]<p[i+1]) or (p[i-1]>p[i]>p[i+1]):
    m +=1
else:
    m +=0

    
print(m)

Buggy submission (verdict: Runtime Error):
n = int(input())
p = list(map(int,input().split()))
m=0

for i in range(2,n):
  if (p[i-1]<p[i]<p[i+1]) or (p[i-1]>p[i]>p[i+1]):
    m +=1
  else:
    m +=0

    
print(m)
Problem p02993 (python)

Fixed submission:
S=input()

if (S[0]==S[1]) or (S[1]==S[2]) or (S[2]==S[3]):
  print("Bad")
else:
  print("Good")

Buggy submission (verdict: Runtime Error):
S=list(map(int,input().split()))

if (S[0]==S[1]) or (S[1]==S[2]) or (S[2]==S[3]):
  print("Bad")
else:
  print("Good")

Buggy submission (verdict: Runtime Error):
S=list(map(int,input().split()))

if (S[0]=S[1]) or (S[1]=S[2]) or (S[2]=S[3]):
  print("Bad")
else:
  print("Yes")
Problem p02999 (python)

Fixed submission:
X,A=map(int,input().split())
if X<A:
  print(0)
else:
  print(10)

Buggy submission (verdict: Runtime Error):
X,A=int(input())

if X<A:
  print(0)
else:
  print(10)
Problem p03035 (python)

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

if A<6:
  print(0)
elif 6<=A<=12:
  print(B//2)
else:
  print(B)

Buggy submission (verdict: Runtime Error):
A,B=int(input())

if B<6:
  print(0)
elif 6<=B<=12:
  print(A/2)
else:
  print(A)

Buggy submission (verdict: Runtime Error):
A,B=int(input())

if A<6:
  print(0)
elif 6<=A<=12:
  print(B/2)
else:
  print(B)

Buggy submission (verdict: Runtime Error):
A,B=int(input())

if A<6:
  print(0)
elif 6<=A<12:
  print(B/2)
else:
  print(B)

Buggy submission (verdict: Runtime Error):
A,B=int(input())

if A<6:
  print(0)
if 6<=A<12:
  print(B/2)
else:
  print(B)
Problem p03061 (python)

Fixed submission:
import fractions
from functools import reduce

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)
  
n = int(input())
A = list(int(i) for i in (input().split()))

front = []
end = []
for i in range(n):
  if(i == 0):
    front.append(gcd(*[A[0]]))
    end.append(gcd(*[A[n-1]]))
  else:
    front.append(gcd(*[front[i - 1],A[i]]))
    end.append(gcd(*[end[i - 1],A[n-1-i]]))

ans = 0
for i in range(n):
  if(i == 0):
    tmp = end[n-2]
  elif(i == n-1):
    tmp = front[n-2]
  else:
    tmp = gcd(*[front[i-1],end[n-2-i]])
  if(ans < tmp):
    ans = tmp
print(ans)

Buggy submission (verdict: Runtime Error):
import fractions
from functools import reduce
import copy

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)
  
n = int(input())
A = list(int(i) for i in (input().split()))

red_list = list(set(A))

ans = 0
tmp = 0
reduce_num = 0
for i in range(len(red_list)):
  if( i != 0): red_list.append(reduce_num)
  reduce_num = red_list.pop(0)
  tmp = gcd_list(red_list)
  if(ans < tmp):
    ans = tmp

print(ans)