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

Fixed submission:
# -*- coding: utf-8 -*-

def main():
     x, y, a, b, c = map(int, input().split())

     # A個の赤いりんごの美味しさ
     p = list(map(int, input().split()))
     # B個の緑のりんごの美味しさ
     q = list(map(int, input().split()))
     # C個の無色のりんごの美味しさ
     r = list(map(int, input().split()))

     p = sorted(p)
     q = sorted(q)
     r = sorted(r, reverse=True)

     p_cut = p[-x:]
     q_cut = q[-y:]

     # print(p_cut)
     # print(q_cut)

     # 無色を1つも使わない場合をベースにする
     red_del = sum(p_cut)
     gre_del = sum(q_cut)
     base_ans = red_del + gre_del

     red_eat = 0
     gre_eat = 0
     cle_eat = 0
     # 交換できる無色を計算
     for i in range(c):
          if red_eat < x and gre_eat < y:
               if p_cut[red_eat] < q_cut[gre_eat]:
                    change = p_cut[red_eat]
                    if change < r[cle_eat]:
                         cle_eat += 1
                         red_eat += 1
                    else:
                         break
               else:
                    change = q_cut[gre_eat]
                    if change < r[cle_eat]:
                         cle_eat += 1
                         gre_eat += 1
                    else:
                         break
          elif red_eat >= x and gre_eat < y:
               change = q_cut[gre_eat]
               if change < r[cle_eat]:
                    cle_eat += 1
                    gre_eat += 1
               else:
                    break
          elif red_eat < x and gre_eat >= y:
               change = p_cut[red_eat]
               if change < r[cle_eat]:
                    cle_eat += 1
                    red_eat += 1
               else:
                    break
          else:
               break

     ans = sum(p_cut[red_eat:]) + sum(q_cut[gre_eat:]) + sum(r[:cle_eat])
     print(ans)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

def main():
     x, y, a, b, c = map(int, input().split())

     # A個の赤いりんごの美味しさ
     p = list(map(int, input().split()))
     # B個の緑のりんごの美味しさ
     q = list(map(int, input().split()))
     # C個の無色のりんごの美味しさ
     r = list(map(int, input().split()))

     p = sorted(p)
     q = sorted(q)
     r = sorted(r, reverse=True)

     p_cut = p[-x:]
     q_cut = q[-y:]

     # print(p_cut)
     # print(q_cut)

     # 無色を1つも使わない場合をベースにする
     red_del = sum(p_cut)
     gre_del = sum(q_cut)
     base_ans = red_del + gre_del

     red_eat = 0
     gre_eat = 0
     cle_eat = 0
     # 交換できる無色を計算
     for i in range(c):
          if p_cut[red_eat] < q_cut[gre_eat]:
               change = p_cut[red_eat]
               if change < r[cle_eat]:
                    cle_eat += 1
                    red_eat += 1
               else:
                    break
          else:
               change = q_cut[gre_eat]
               if change < r[cle_eat]:
                    cle_eat += 1
                    gre_eat += 1
               else:
                    break
     
     ans = sum(p_cut[red_eat:]) + sum(q_cut[gre_eat:]) + sum(r[:cle_eat])
     print(ans)

if __name__ == "__main__":
    main()
Problem p02713 (python)

Fixed submission:
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
  
K = int(input())
A = B = C = [i for i in range(1, K+1)]

L = [gcd(a,b) for a in A for b in B]

cnt = sum([gcd(l,c) for l in L for c in C])   
print(cnt)

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
    for i in range(200):
      a, b = b, a%b
      return a if b == 0
  
K = int(input())
A = B = C = [i for i in range(1, K+1)]
cnt = sum([gcd(gcd(a,b),c) for a in A for b in B for c in C])   
print(cnt)

Buggy submission (verdict: Runtime Error):
import fractions
K = int(input())
A = [i for i in range(1, K)]
B = [i for i in range(1, K)]
C = [i for i in range(1, K)]

cnt = 0
for a in A:
  for b in B:
    for c in C:
      N = [a,b,c]
      ans = N[0]
      for i in range(1, 3):
        ans = fractions.gcd(ans, a[i])
      cnt += ans
print(cnt)
Problem p02724 (python)

Fixed submission:
X = int(input())
 
div = int(X/500)
mod = int(X%500)
hap = 0
 
if div != 0:
  hap = div*1000
q = int(mod/5)
hap += q*5
 
print(hap)

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

div = int(X/500)
mod = int(X%500)
hap = 0

if div != 0:
  hap = i
q = int(p/5)
hap += q

print(hap)
Problem p02765 (python)

Fixed submission:
N, R = map(int, input().split())
if N>= 10:
  print(R)
else:
  print(R+1000-100*N)

Buggy submission (verdict: Runtime Error):
N, R = map(int, input().solit())
if N>= 10:
  print(R)
else:
  print(R+1000-100*N)
Problem p02767 (python)

Fixed submission:
N = int(input())
X = list(map(int, input().split()))
 
cost = 10**10
 
for i in range(1, 101):
  cand = sum([(x-i)**2 for x in X])
  cost = min(cost, cand)

print(cost)

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

cost = 0

for i in range(1, 101):
  cand = 0
  for x in X:
    cand += (x[i]-i)**2
  cost = min(cost, cand)

print(cost)
Problem p02969 (python)

Fixed submission:
r = int(input())
print(3*r*r)

Buggy submission (verdict: Runtime Error):
import math
N, D = map(int,input().split())
print(N, D)
cnt = math.floor(N/(2*D+1))
if N%(2*D+1) != 0:
  cnt += 1
print(cnt)
Problem p02971 (python)

Fixed submission:
N=int(input())
A=[int(input()) for i in range(N)]
#print(A)
B = A.copy()
#print(B)
B.sort()


for i in range(N):
	k = A[i]
	#print(k)
	if k != B[N-1]:
		print(B[N-1])
	else:
		print(B[N-2])

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[int(input()) for i in range(N)]
B = A.copy()
B.sort()
print(B)

for i in range(N):
	k = A.pop(0)
	if k == B[N]:
		print(B[N])
	else:
		print(B[N-1])

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[int(input()) for i in range(N)]
amax = max(A)
B = A.copy()
B.sort()
print(B)

for i in range(N):
	k = A.pop(0)
	if k == B[N]:
		print(B[N])
	else:
		print(amax)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[int(input()) for i in range(N)]
amax = max(A)
B = A.copy()
B.sort()
print(B)

for i in range(N):
	k = A.pop(0)
    if k == B[N]:
      print(B[N])
	else:
	  print(amax)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[int(input()) for i in range(N)]
amax = max(A)
for i in range(N):
	if amax==A[i]:
		print(amax)
	else:
		print(max(B))
Problem p02981 (python)

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

if N*A>B:
	print(B)
else:
	print (A*N)

Buggy submission (verdict: Runtime Error):
l,r = map(int,input().split())
ans = 2019
mod = 2019
 
for i in range(l,r):
  for j in range(i+1,r):
    ans = min(ans,(i*j)%mod)
    if ans == 0:
      print(0)
      exit()
print(ans)

Buggy submission (verdict: Runtime Error):
L, R = map(int, input().split())



#print(L%2019, R%2019)

#print((L + 2019 - L%2019))

tmp = 0
"""
if L * R < 2019:
	i = L
	j = R

elif (L + 2019 - L%2019) + 1 <= R:
	if L < L + 2019 - L % 2019 and L + 2019 - L % 2019 + 1 < R:
		i =  L + 2019 - L % 2019
		j = i+1

elif L % 2019 < R % 2019:
	i = L
	j = i+1

elif R % 2019 > L % 2019:
	j = R
	i = j-1

else:
	i = L
	j = R
"""

i = 2019 - np.abs(L-R)
j = i+1

ans = i * j % 2019

print(ans)
Problem p02983 (python)

Fixed submission:
l,r = map(int,input().split())
ans = 2019
mod = 2019
 
for i in range(l,r):
  for j in range(i+1,r+1):
    ans = min(ans,(i*j)%mod)
    if ans == 0:
      print(0)
      exit()
print(ans)

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

L, R = map(int, input().split())

tmp = 0
ans = 2019

i = L
j = R
tmp = (i * j) % 2019
if tmp < ans:
	ans = tmp
if (L + 2019 - L%2019) + 1 <= R:
	i =  L + 2019 - L % 2019
	j = i+1
	tmp = (i * j) % 2019
		if tmp < ans:
			ans = tmp

i = L
j = i+1
tmp = (i * j) % 2019
if tmp < ans:
	ans = tmp

j = R
i = j-1
tmp = (i * j) % 2019
if tmp < ans:
	ans = tmp

i = L
j = R
tmp = (i * j) % 2019
if tmp < ans:
	ans = tmp

print(ans)

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

L, R = map(int, input().split())

tmp = 0
ans = 2019

i = L
j = R
tmp = (i * j) % 2019
if tmp < ans:
	ans = tmp

i =  L + 2019 - L % 2019
j = i+1
tmp = (i * j) % 2019
	if tmp < ans:
		ans = tmp

i = L
j = i+1
tmp = (i * j) % 2019
if tmp < ans:
	ans = tmp

j = R
i = j-1
tmp = (i * j) % 2019
if tmp < ans:
	ans = tmp

i = L
j = R
tmp = (i * j) % 2019
if tmp < ans:
	ans = tmp

print(ans)
Problem p02996 (python)

Fixed submission:
from operator import itemgetter
import sys
 
N = int(input())
 
listA=[] #appendのために宣言が必要
while True:
    try:
        listA.append(list(map(int,input().split())))
 
    except:
        break;
 
#print(listA)
 
listB = sorted(listA)
la = sorted(listB, key=itemgetter(1))
 
t = 0
for i in range(N):
	s = la[i][1]
	t += la[i][0]
	if t > s:
		print("No")
		sys.exit()
 
print('Yes')

Buggy submission (verdict: Runtime Error):
from operator import itemgetter
 
N = int(input())
 
listA=[] #appendのために宣言が必要
while True:
    try:
        listA.append(list(map(int,input().split())))
 
    except:
        break;
 
#print(listA)
 
listB = sorted(listA)
#print(listB)
listC = sorted(listB, key=itemgetter(1))
#print(listC)
flag = 0
time = 0
 
for i in range(N):
	time += listC[i][0]
	#print(time)
	listC.pop(0)
	if time > listC[i][1]:
		flag = 1
		break
 
if flag==0:
	print('Yes')
elif flag==1:
	print('No')

Buggy submission (verdict: Runtime Error):
from operator import itemgetter
import sys
 
N = int(input())
 
listA=[] #appendのために宣言が必要
while True:
    try:
        listA.append(list(map(int,input().split())))
 
    except:
        break;
 
#print(listA)
 
listB = sorted(listA)
la = sorted(listB, key=itemgetter(1))
t = 0
 
t = 0
for i in range(n):
	s = la[i][1]
	t += la[i][0]
	if t > s:
		print("No")
		sys.exit()
 
print('Yes')
Problem p03059 (python)

Fixed submission:
a, b, t = (int(i) for i in input().split())  
print(int(t/a)* b)

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

N = int(input())
A = [int(i) for i in input().split()] 
Acnt = 0
for i in range(N):
	if A[i] < 0:
		Acnt += 1
res = np.sum(np.abs(A)) - np.min(np.abs(A))*2
print(res)

Buggy submission (verdict: Runtime Error):
a, b, t = (int(i) for i in input().split())  
print(int(t/a* b)
Problem p03061 (python)

Fixed submission:
# -*- coding: utf-8 -*-

def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

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

# GCDの結合則を利用する
# 左端、右端からの累積GCDを求めておくと、Aiを取り除いた場合のGCDがすぐに計算できる。
# つまり、
# L(i): n=0,...,iまでのGCD 
# R(i): n=i,...,N-1までのGCD
# このとき、Aiを除いた全体のGCDは、GCD(L(i-1), R(i+1))で計算できる。

L = [0] * N
R = [0] * N

L[0] = A[0]
R[-1] = A[-1]
for i in range(1, N):
    L[i] = gcd(L[i-1], A[i])
    idx = N-1-i
    R[idx] = gcd(R[idx+1], A[idx])

mx = 0
for i in range(N):
    if i == N-1:
        v = L[N-2]
    elif i == 0:
        v = R[1]
    else:
        v = gcd(R[i+1], L[i-1])
    mx = max(v, mx)
print(mx)

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

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

L = [0]*N
R = [0]*N

L[0] = A[0]
r[-1] = A[-1]

for i in range(1, N):
	L[i] = gcd(L[i], A[i])
	idx = N-1-i
	R[i] = gcd(R[idx], A[idx])

#残りの N − 1 個の整数の最大公約数
mx = 0
for i in range(N):
	if i==N-1:	#後ろから1個めが抜かれた時
		v = L[N-2]
	elif i==0:	#前から1個めが抜かれた時
		v = R[1]
	else:		#どれでもない時
		v = gcd(R[i+1], L[i-1])
	mx = max(v, mx)
print(mx)

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

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

L = [0]*N
R = [0]*N

L[0] = A[0]
r[-1] = A[-1]

for i in range(1, N):
	L[i] = gcd(L[i], A[i])
	idx = N-1-i
	R[i] = gcd(R[idx], A[idx])

#残りの N − 1 個の整数の最大公約数
mx = 0
for i in range(N):
	if i==N-1:	#後ろから1個めが抜かれた時
		v = L[N-2]
	elif i==0:	#前から1個めが抜かれた時
		v = R[1]
	else:		#どれでもない時
		v = gcd(L[i+1], R[i-1])
	mx = max(v, mx)
print(mx)

Buggy submission (verdict: Runtime Error):
import fractions
import functools
N=int(input())
A=[int(i) for i in input().split()] 
#max_gcd=functools.reduce(fractions.gcd, A)
for i in range(N):
	tmp=A.copy()
	tmp.pop(i)
	gcd=functools.reduce(fractions.gcd, tmp)
	if max_gcd<gcd:
		max_gcd=gcd
print(max_gcd)
Problem p03494 (python)

Fixed submission:
N = int(input())
li = list(map(int,input().split()))	
count = 0
flag = True

while flag==True:
	for i in range(N):
		if li[i]%2!=0:
			flag=False
		else:
			li[i] = li[i] // 2
	if flag==True:
		count += 1
print(count)

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

while:
	for i in range(N):
		if li[i]%2!=0:
			break
	count += 1
print(count)
Problem p03206 (python)

Fixed submission:
d=int(input())
d=-(d-25)
c="Christmas"
e="Eve"
for i in range(0,4):
    if d==i:
        print(c,end="")
        if i>0:
            for j in range(i):
                print(" "+e,end="")
        print()

Buggy submission (verdict: Runtime Error):
d=input()
d=-(d-25)
c="Chrismas"
e="Eve"
for i in range(0,4):
    if d==i:
        print(c,end="")
        if i>0:
            for j in range(i-1):
                print(" "+e)
        print()
Problem p02696 (python)

Fixed submission:
import math

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

if n < b:
    ans = math.floor(a*n/b) - a * math.floor(n/b)
    print(ans)
else:
    ans = a - (a-1) // b - 1
    print(ans)

Buggy submission (verdict: Runtime Error):
import math

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

max_ans = math.floor(a*n/b) - a*math.floor(n/b)
for x in range(n, 1, -1):
    ans = math.floor(a*x/b) - a*math.floor(x/b)
    if max_ans <= ans:
        print(ans)
        break
else:
    print(ans)
Problem p02727 (python)

Fixed submission:
x, y, a, b, c = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))

ans_p = sorted(p, reverse=True)[:x][::-1]
ans_q = sorted(q, reverse=True)[:y][::-1]
r.sort(reverse=True)

p_index = 0
q_index = 0
used_r_sum = 0

for max_r in r:
    ans_p_p_index = ans_p[p_index] if p_index < x else float('inf')
    ans_q_q_index = ans_q[q_index] if q_index < y else float('inf')
    if ans_p_p_index < ans_q_q_index:
        if ans_p_p_index < max_r:
            p_index += 1
            used_r_sum += max_r
        else:
            break
    else:
        if ans_q_q_index < max_r:
            q_index += 1
            used_r_sum += max_r
        else:
            break


print(sum(ans_p[p_index:])+sum(ans_q[q_index:])+used_r_sum)

Buggy submission (verdict: Runtime Error):
import bisect


x, y, a, b, c = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))

ans_p = sorted(p, reverse=True)[:x][::-1]
ans_q = sorted(q, reverse=True)[:y][::-1]
r.sort(reverse=True)

p_index = 0
q_index = 0
used_r_sum = 0

for max_r in r:
    if ans_p[p_index] < ans_q[q_index]:
        if ans_p[p_index] < max_r:
            p_index += 1
            used_r_sum += max_r
        else:
            break
    else:
        if ans_q[q_index] < max_r:
            q_index += 1
            used_r_sum += max_r
        else:
            break


print(sum(ans_p[p_index:])+sum(ans_q[q_index:])+used_r_sum)
Problem p03001 (python)

Fixed submission:
W, H, x, y = map(float, input().split())

print(H*W/2)

if x == W/2 and y == H/2:
    print(1)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
W, H, x, y = map(float, input().split())

print(H*W/2)

if x = W/2 and y = H/2:
    print(1)
else:
    print(0)
Problem p03014 (python)

Fixed submission:
import sys
input = sys.stdin.readline
import numpy as np

H, W = map(int, input().split())
S = np.array([list(input().rstrip()) for _ in range(H)]) == '.'
ups = np.zeros((H,W), dtype=int)
downs = np.zeros((H,W), dtype=int)
lefts = np.zeros((H,W), dtype=int)
rights = np.zeros((H,W), dtype=int)

for h in range(1, H):
    ups[h] = (ups[h-1] + 1) * S[h-1]
    downs[H-h-1] = (downs[H-h] + 1) * S[H-h]
for w in range(1, W):
    lefts[:, w] = (lefts[:, w-1] + 1) * S[:, w-1]
    rights[:, W-w-1] = (rights[:, W-w] + 1) * S[:, W-w]
print(np.amax((ups+downs+lefts+rights)*S)+1)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
import numpy as np

H, W = map(int, input().split())
S = np.array([list(input()) for _ in range(H)]) == '.'
ups = np.zeros((H,W), dtype=int)
downs = np.zeros((H,W), dtype=int)
lefts = np.zeros((H,W), dtype=int)
rights = np.zeros((H,W), dtype=int)

for h in range(H):
    ups[h] = (ups[h-1] + 1) * S[h-1]
    downs[H-h-1] = (downs[H-h-1] + 1) * S[H-h-1]
for w in range(W):
    lefts[:, w] = (lefts[:, w-1] + 1) * S[w-1]
    rights[:, W-w-1] = (rights[:, W-w-1] + 1) * S[W-w-1]
print(np.amax((ups+downs+lefts+rights)*S)+1)

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
S = [list(input()) for _ in range(H)]
ans = 0
for i in range(H):
    for j in range(W):
        if S[i][j] == '#':
            continue
        cnt = 1
        a = i
        b = j
        while a+1 <= H-1:
            if S[a+1][b] == '#':
                break
            cnt += 1
            a += 1
        a = i
        while a-1 >= 0:
            if S[a-1][b] == '#':
                break
            cnt += 1
            a -= 1
        a = i
        b = j
        while b+1 <= W-1:
            if S[a][b+1] == '#':
                break
            cnt += 1
            b += 1
        b = j
        while b-1 <= 0:
            if S[a][b-1] == '#':
                break
            cnt += 1
            b -= 1
        ans = max(ans, cnt)
print(ans)
Problem p03035 (python)

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

Buggy submission (verdict: Runtime Error):
A, B = map(int,input().split())
print(B if A >= 13)
print(0 if A <= 5 else b//2)
Problem p03048 (python)

Fixed submission:
R, G, B, N = map(int,input().split())
cnt = 0
for r in range(N//R + 1):
    for g in range((N-R*r)//G + 1):
        x = N - R*r - G*g
        if x >= 0 and x % B == 0:
            cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
R, G, B, N = map(int,input().split())
cnt = 0
for r in range(N//R + 1):
    for g in range(N//G + 1):
        x = (N - R*r - G*g) / B
        if isinstance(x, int)
            cnt += 1
print(cnt)
Problem p03049 (python)

Fixed submission:
n = int(input())
S = [input() for i in range(n)]
cnt = 0
a = 0
b = 0
ba = 0
for i in range(n):
    cnt += S[i].count("AB")
    if S[i].startswith("B") and S[i].endswith("A"):
        ba += 1
    elif S[i].startswith("B"):
        b += 1
    elif S[i].endswith("A"):
        a += 1
if ba >= 1:
    cnt += ba - 1
    if a >= 1:
        cnt += 1
        a -= 1
    if b >= 1:
        cnt += 1
        b -= 1
    cnt += min(a, b)
elif a >= 1 and b >= 1:
    cnt += min(a, b)
print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
S = [input() for i in range(n)]
cnt = 0
a = 0
b = 0
ba = 0
for i in range(n):
    cnt += S[i].count("AB")
    if S[i].startswith("B") and S[i].endswith("A")
        ba += 1
    elif S[i].startswith("B"):
        a += 1
    elif S[i].endswith("A"):
        b += 1
if ba >= 1:
    cnt += ba - 1
if a >= 1:
    cnt += 1
if b >= 1:
    cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
S = [input() for i in range(n)]
cnt = 0
a = 0
b = 0
ba = 0
for i in range(n):
    cnt += S[i].count("AB")
    if S[i].startswith("B") and S[i].endswith("A")
        ba += 1
    elif S[i].startswith("B"):
        a += 1
    elif S[i].endswith("A"):
        b += 1
if ba >= 1
    cnt += ba - 1
if a >= 1:
    cnt += 1
if b >= 1:
    cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
S = [input() for i in range(n)]
cnt = 0
a = 0
b = 0
ba = 0
for i in range(n):
    cnt += S[i].count("AB")
    if S[i].startswith("B") and S[i].endswith("A")
        ba += 1
    elif S[i].startswith("B"):
        a += 1
    elif S[i].endswith("A"):
        b += 1
cnt += ba - 1
if a >= 1:
    cnt += 1
if b >= 1:
    cnt += 1
print(cnt)
Problem p03059 (python)

Fixed submission:
from math import floor
a, b, t = map(int,input().split())
num = floor(t / a)
print(num * b)

Buggy submission (verdict: Runtime Error):
n = int(input())
A = list(map(int,input().split()))
gcd_list = []
max_element = max(A)

def gcd(a, b):
    while a % b != 0:
        b_next = a % b
        a = b
        b = b_next
    return b

for i in range(n):
    y = A[i]
    for j in range(1, max_element + 1):
        A[i] = j
        x = A[0]
        for k in range(1, n):
            x = gcd(x, A[k])
        gcd_list.append(x)
    A[i] = y
print(max(gcd_list))

Buggy submission (verdict: Runtime Error):
n = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
goods_list = []
for i in range (n):
    x = V[i] - C[i]
    if x > 0:
        goods_list.append(x)
print(sum(goods_list))
Problem p03067 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
str = list(input())
K = int(input())
str_list = list(str)
for i in range(N):
    if str[i] != str[K]:
        str[i] = '*'
str_changed = ''.join(str)
print(str_changed)
Problem p03068 (python)

Fixed submission:
N = int(input())
str = list(input())
K = int(input()) - 1
str_list = list(str)
for i in range(N):
    if str[i] != str[K]:
        str[i] = '*'
str_changed = ''.join(str)
print(str_changed)

Buggy submission (verdict: Runtime Error):
N = int(input())
str = str(input())
K = int(input())
str_list = list(str)
for i in range(N):
    if str_list[i] != str_list[int(K)]:
        str_list[i] = '*'
str_changed = ''.join(str_list)
print(str_changed)

Buggy submission (verdict: Runtime Error):
N = int(input())
str = str(input())
K = int(input())
str_list = list(str)
for i in range(N):
    if str_list[i] != str_list[int(K)]:
        str_list[i] = '*'
str_changed = ''.join(str_list)
print(str_changed)

Buggy submission (verdict: Runtime Error):
N = int(input())
str = str(input())
K = int(input())
str_list = list(str)
for i in range(N):
    if str_list[i] != str_list[int(K)]:
        str_list[i] = '*'
str_changed = ''.join(str_list)
print(str_changed)
Problem p03076 (python)

Fixed submission:
from math import ceil
time_list = [int(input()) for i in range(5)]
sum_list = []
time_list_0 = []
for i in range(5):
    time_list_0.append(ceil(time_list[i] / 10) * 10)
for j in range(5):
    if time_list[j] % 10 == 0:
        sum_list.append(sum(time_list_0))
    else:
        sum_list.append(sum(time_list_0) - 10 + (time_list[j] % 10))
print(min(sum_list))

Buggy submission (verdict: Runtime Error):
from math import ceil
time_list = [int(input()) for i in range(5)]
sum_list = []
time_list_0 = []
for i in range(5):
    time_list_0[i] = ceil(time_list[i] / 10) * 10
for j in range(5):
    if time_list[j] == 0:
        sum_list[j] = sum(time_list_0)
    else:
        sum_list[j] = sum(time_list_0) - 10 + (time_list[j] % 10)
print(min(sum_list))

Buggy submission (verdict: Runtime Error):
from math import ceil
time_list = [int(input()) for i in range(5)]
sum_list = []
time_list_0 = []
for i in range(5):
    time_list_0[i] = ceil(time_list[i] / 10) * 10
for j in range(5):
    if time_list[i] == 0:
        sum_list[i] = sum(time_list_0)
    else:
        sum_list[i] = sum(time_list_0) - 10 + time_list[i] % 10
print(min(sum_list))

Buggy submission (verdict: Runtime Error):
from math import ceil
time_list = [int(input()) for i in range(5)]
sum_list = []
time_list_0 = []
for i in range(5):
    time_list_0[i] = ceil(time_list[i] / 10) * 10
for j in range(5):
    sum_list[i] = sum(time_list_0) - 10 + time_list[i] % 10
print(min(sum_list))
Problem p03087 (python)

Fixed submission:
N, Q = map(int, input().split())
S = input()
t = [0] * (N + 1)
for i in range(N):
	t[i + 1] = t[i] + (1 if S[i : i + 2] == 'AC' else 0)
for i in range(Q):
	l, r = map(int, input().split())
	print(t[r-1] - t[l-1])

Buggy submission (verdict: Runtime Error):
n, q = map(int,input().split())
S = list(input())
L = []
R = []
for i in range(q):
    l, r = [int(i) for i in input().split()]
    L.append(l)
    R.append(r)
for i in range(q):
    S_0 = ""
    for k in range(L[i], R[i] + 1):
        S_0 += S[k]
    print(S_0.count("AC"))