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

Fixed submission:
N = int(input())

ans = [0 for _ in range(10050)]

for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            a = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if a < 10050:
                ans[a] += 1
for i in range(1,N+1):
    print(ans[i])

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

x,y,z = 1,1,1

def is_true(x,y,z,i):
    if x**2 + y**2 + z**2 + x*y + y*z + z*x == i:
        return True
    return False

loop = int(N ** (1/2))

for i in range(5):
    print(0)
print(1)

for i in range(7,N+1):
    a = 0
    b = 0
    c = 0
    if i
    for ai in range(loop):
        for bi in range(loop):
            for ci in range(loop):
                X = x+a
                Y = y+b
                Z = z+c
                if is_true(X,Y,Z,i):
                    count += 1
    print(count)

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

x,y,z = 1,1,1

def is_true(x,y,z,i):
    if x**2 + y**2 + z**2 + x*y + y*z + z*x == i:
        return True
    return False

loop = int((N-2) ** (1/2)) - 1
for i in range(1,N+1):
    count = 0

    if i < 6:
        print(count)
        continue
    for a in range(loop):
        for b in range(loop):
            for c in range(loop):
                X = x+a
                Y = y+b
                Z = z+c
                if is_true(X,Y,Z,i):
                    count += 1
    print(count)
Problem p02576 (python)

Fixed submission:

from enum import Enum
from queue import Queue
import collections

import sys
import math

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001
N,X,T = list(map(int,input().split()))
print(math.ceil(N/X)*T)

Buggy submission (verdict: Runtime Error):
import math
from collections import deque

H,W = map(int, input().split())
ch,cw = map(int,input().split())
dh,dw = map(int, input().split())

#input maze information
s = ["#"*(W+4)]
s.append("#"*(W+4))
for i in range(H):
    s.append("##"+input()+"##")
s.append("#"*(W+4))
s.append("#"*(W+4))

ans = [[-1]*(W*4) for _ in range(H+4)]
for i in range(H+4):
    for j in range(W+4):
        if s[i][j] == "#":
            ans[i][j] = -2 #壁があるところは−２と重みをつけておく

ch += 1
cw += 1
dh += 1
dw += 1
ans[ch][cw]=0

move = [[-1,0],[1,0],[0,1],[0,-1]]
magic = [
    [-2,-2],[-2,-1],[-2,0],[-2,1],[-2,2],\
    [-1,-2],[-1,-1],[-1,0],[-1,1],[-1,2],\
    [0,-2],[0,-1],[0,0],[0,1],[0,2],\
    [1,-2],[1,-1],[1,0],[1,1],[1,2],\
    [2,-2],[2,-1],[2,0],[2,1],[2,2]
    ]

list1=deque([])
list2=deque([])
list1.append([ch,cw])

while len(list1)>0:
    x,y = list1.popleft()
    list2.append([x,y])
    for p,q in move:
        v1,v2 = x+p,y+q
        if ans[v1][v2] == -1:
            list1.append([v1,v2])
            ans[v1][v2] = ans[x][y]
    if len(list1)==0:
        while len(list2) > 0:
            x2,y2 = list2.popleft()
            for v1,v2 in magic:
                i,j = x2+v1,y2+v2
                if ans [i][j] == -1:
                    ans[i][j] = ans[x2][y2]+1
                    list1.append([i,j])
print(ans[dh][dw])
Problem p02585 (python)

Fixed submission:
#import math
#import numpy as np

N, K = map(int,input().split())
P = list(map(int,input().split()))
C = list(map(int,input().split()))
#for i in range(len(P)): #Pの中身は次の動く先の位置なのでデクリメントする
#    P[i] -= 1

ans = -99999999999999

for i in range(N):
    x = i
    total = 0
    s=[]
    while(1):#サイクルごとに長さをまず求める，
        x = P[x]-1
        s.append(C[x])
        total += C[x]
        if x == i:
            break
    l = len(s)#サイクルの長さ
    t = 0
    for i in range(l):#サイクルの中でどこで終わるのがベストか探す
        t += s[i]
        if i+1> K:#Kがサイクルより短かったらそこで終わる
            break
        now = t
        if total > 0:
            cycle = int((K-i-1)/l)
            now += total*cycle

        ans = max(ans, now)

print(ans)

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

N, K = map(int,input().split())
P = list(map(int,input().split()))
C = list(map(int,input().split()))
for i in range(len(P)): #Pの中身は次の動く先の位置なのでデクリメントする
    P[i] -= 1

ans = -99999999999999

for i in range(N):
    x = i
    total = 0
    s=[]
    while(1):#サイクルごとに長さをまず求める，
        x = P[x]
        s.append(C[x])
        total += C[x]
        if x == i:
            break
    l = len(s)#サイクルの長さ
    t = 0
    for i in range(l):#サイクルの中でどこで終わるのがベストか探す
        t += s[i]
        if i+1> K:#Kがサイクルより短かったらそこで終わる
            break
        now = t
        if total > 0:
            cycle = int((K-i-1)/l)
            now += total*cycle

        ans = max(ans, now)

print(ans)
Problem p02889 (python)

Fixed submission:
from enum import Enum
from queue import Queue

import numpy as np

import collections
import bisect
import sys
import math

from scipy.sparse.csgraph import floyd_warshall

BIG_NUM = 200000000000
MOD = 1000000007
EPS = 0.000000001

def warshall_floyd(d,n):
    #d[i][j]:iからjへの最短距離
    for k in range(n):
        for i in range(n):
            for j in range(n):
                d[i][j] = min(d[i][j],d[i][k] + d[k][j])
    return d

N,M,L = map(int,input().split())
d = [[float("inf") for i in range(N)] for j in range(N)]
for i in range(M):
    a,b,c = map(int,input().split())
    d[a-1][b-1] = c
    d[b-1][a-1] = c
for i in range(N):
    d[i][i] = 0
d = floyd_warshall(d)
for i in range(N):
    for j in range(i,N):
        if d[i][j] <= L:
            d[i][j] = 1
            d[j][i] = 1
        else:
            d[i][j] = float("inf")
            d[j][i] = float("inf")
    d[i][i] = 1
d = floyd_warshall(d)
Q = int(input())
for q in range(Q):
    s,t = map(int,input().split())
    if d[s-1][t-1] == float("inf"):
        print(-1)
    else:
        print(int(d[s-1][t-1])-1)

Buggy submission (verdict: Runtime Error):
from enum import Enum
from queue import Queue

import numpy as np

import collections
import bisect
import sys
import math

BIG_NUM = 200000000000
MOD = 1000000007
EPS = 0.000000001

def warshall_floyd(d,n):
    #d[i][j]:iからjへの最短距離
    for k in range(n):
        for i in range(n):
            for j in range(n):
                d[i][j] = min(d[i][j],d[i][k] + d[k][j])
    return d

N,M,L = map(int,input().split())
d = [[BIG_NUM for i in range(N)] for j in range(N)]
for i in range(M):
    a,b,c = map(int,input().split())
    d[a-1][b-1] = c
    d[b-1][a-1] = c
for i in range(N):
    d[i][i] = 0

d = warshall_floyd(d,N)
for i in range(N):
    for j in range(i,N):
        if d[i][j] < L:
            d[i][j] = 1
            d[j][i] = 1
        else:
            d[i][j] = 0
            d[j][i] = 0
    d[i][i] = 1

d = warshall_floyd(d,N)
Q = int(input())
for q in range(Q):
    s,t = map(int,input().split())
    if d[s][t] <= BIG_NUM:
        print(-1)
    else:
        print(int(d[s][t]-1))
Problem p02899 (python)

Fixed submission:
from enum import Enum
from queue import Queue

import numpy as np

import collections
import bisect
import sys
import math

from scipy.sparse.csgraph import floyd_warshall

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

B = [0]*N

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

print(*B)

Buggy submission (verdict: Runtime Error):
from enum import Enum
from queue import Queue

import numpy as np

import collections
import bisect
import sys
import math

from scipy.sparse.csgraph import floyd_warshall

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

B = [0]*N

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

print(B*)
Problem p02900 (python)

Fixed submission:
from enum import Enum
from queue import Queue

import numpy as np

import collections
import bisect
import sys
import math

from scipy.sparse.csgraph import floyd_warshall

"""nを素因数分解"""
def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct
 #最大公約数
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a


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

G = gcd(A,B)

c = collections.Counter(factorize(G))
print(len(list(c.keys()))+1)

Buggy submission (verdict: Runtime Error):
from enum import Enum
from queue import Queue

import numpy as np

import collections
import bisect
import sys
import math

from scipy.sparse.csgraph import floyd_warshall

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

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

G = math.gcd(A,B)

c = collections.Counter(factorizzation(G))
print(len(list(c.keys()))+1)
Problem p02911 (python)

Fixed submission:
from enum import Enum
from queue import Queue

import numpy as np

import collections
import bisect
import sys
import math

from scipy.sparse.csgraph import floyd_warshall
N,K,Q = map(int,input().split())
score = [K] * N

for i in range(Q):
    win = int(input())
    score[win-1] += 1

for i in range(N):
    if score[i]-Q > 0:
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
from enum import Enum
from queue import Queue

import numpy as np

import collections
import bisect
import sys
import math

from scipy.sparse.csgraph import floyd_warshall
N,K,Q = map(int,input().split())
A=[]*N
score = [K] * N

for i in range(Q):
    win = int(input())
    score[win] += 1

for i in range(N):
    if score[i]-Q > 0:
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
from enum import Enum
from queue import Queue

import numpy as np

import collections
import bisect
import sys
import math

from scipy.sparse.csgraph import floyd_warshall
N,K,Q = map(int,input().split())
A=[]*Q
score = [K] * N

for i in range(Q):
    win = int(input())
    score[win] += 1

for i in range(N):
    if score[i]-Q > 0:
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
from enum import Enum
from queue import Queue

import numpy as np

import collections
import bisect
import sys
import math

from scipy.sparse.csgraph import floyd_warshall
N,K,Q = map(int,input().split())
A=[]*Q
score = [K] * N

for i in range(Q):
    win = int(input())
    score[win] += 1

for i in range(Q):
    if score[i]-Q > 0:
        print('Yes')
    else:
        print('No')
Problem p02923 (python)

Fixed submission:
from enum import Enum
from queue import Queue
import collections

import sys
import math

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001
N = int(input())
H = list(map(int,input().split()))
cnt = 0
ans = 0
for i in range(N-1):
    if H[i] >= H[i+1]:
        cnt += 1
    else:
        if ans <= cnt:
            ans = cnt
        cnt = 0

if ans <= cnt:
    ans = cnt
print(ans)

Buggy submission (verdict: Runtime Error):
from enum import Enum
from queue import Queue
import collections

import sys
import math

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001
N = int(input())
H = list(map(int,input().split()))
cnt = 0
for i in range(N-1):
    if H[i] >= H[i+1]:
        cnt += 1
    else:
        if ans <= cnt:
            ans = cnt
        cnt = 0

if ans <= cnt:
    ans = cnt
print(ans)

Buggy submission (verdict: Runtime Error):
from enum import Enum
from queue import Queue
import collections

import sys
import math

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001
N = int(input())
H = list(map(int,input().split()))
cnt = 0
for i in range(N-1):
    if H[i] >= H[i+1]:
        cnt += 1
    else:
        ans = cnt
        cnt = 0

if ans <= cnt:
    ans = cnt
print(ans)
Problem p03361 (python)

Fixed submission:
H, W = list(map(int, input().split()))
s = []
s.append(['.']*(W+2))
for i in range(H):
    #二次元配列に入力を入れる
    array =['.']
    array.extend(list(input()))
    array.extend(['.'])
    s.append(array)
s.append(['.']*(W+2))
#print(s)
count = 0
for i in range(1,H+1):
    for j in range(1,W+1):
        if(s[i][j] == '#' and s[i][j-1] != '#' and s[i][j+1] != '#' and s[i-1][j] != '#' and s[i+1][j] != '#'):
            count = count+1

if (count==0):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
H, W = list(map(int, input().split()))
s = []
s.append(['.']*(W+2))
for i in range(H):
    #二次元配列に入力を入れる
    array =['.']
    array.extend(list(input()))
    array.extend(['.'])
    s.append(array)
s.append(['.']*(W+2))
#print(s)
count = 0
for i in range(1,W+1):
    for j in range(1,H+1):
        if(s[i][j] == '#' and s[i][j-1] != '#' and s[i][j+1] != '#' and s[i-1][j] != '#' and s[i+1][j] != '#'):
            count += 1

if (count==0):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
H, W = list(map(int, input().split()))
s = []
s.append(['.']*(W+2))
for i in range(W):
    #二次元配列に入力を入れる
    array =['.']
    array.extend(list(input()))
    array.extend(['.'])
    s.append(array)
s.append(['.']*(W+2))
count = 0
for i in range(1,W+1):
    for j in range(1,H+1):
        if(s[i][j] == '#' and s[i][j-1] != '#' and s[i][j+1] != '#' and s[i-1][j] != '#' and s[i+1][j] != '#'):
            count += 1

if (count==0):
    print("Yes")
else:
    print("No")
Problem p03399 (python)

Fixed submission:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
fee=0
if A<B:
    fee=fee+A
else:
    fee=fee+B
if C<D:
    fee=fee+C
else:
    fee=fee+D

print(fee)

Buggy submission (verdict: Runtime Error):
A=input()
B=input()
C=input()
D=input()
fee=0
if A<B:
    fee=fee+A
else:
    fee=fee+B
if C<D:
    fee=fee+C
else:
    fee=fee+D

print(fee)
Problem p03415 (python)

Fixed submission:
a=input()
one_list=list(a)
b=input()
two_list=list(b)
c=input()
three_list=list(c)
print('{0}{1}{2}'.format(a[0],b[1],c[2]))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a>2 and b>2:
    cnt=a*b-(a*2+b*2-4)
elif (a==1 and b>2) or (a>2 and b==1):
    cnt=a*b-2
elif (a==2 or b==2):
    cnt=0
elif a==1 and b==1:
    cnt=1
print(cnt)

Buggy submission (verdict: Runtime Error):
nput()
one_list=list(a)
b=input()
two_list=list(b)
c=input()
three_list=list(c)
print('{0}{1}{2}'.format(a[0],b[1],c[2]))
Problem p03471 (python)

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

a=-1
b=-1
c=-1
for i in range(0,N+1):
    for j in range(0,N-i+1):
        if 10000*i+5000*j+1000*(N-i-j)==Y:
            a=i
            b=j
            c=N-i-j
            break
                            
print(a,b,c)

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

a=-1
b=-1
c=-1
for i in range(0,N+1):
    for j in range(0,N-i+1):
        if 10000*i+5000*j+1000*(N-i-j)==Y:
            a=i
            b=j
            c=N-i-j
            break
                            
print(a,b,c)

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

for i in range(0,N+1):
    a=10000*i
    if a>Y:
        continue
    for j in range(0,N-i+1):
        a+=5000*j
        if a>Y:
            continue
        for k in range(0,N-i-j+1):
            a+=1000*k
            if 10000*i+5000*j+1000*k==Y:
                print(i,"",j,"",k)
                break
else:
    print(-1,'',-1,'',-1)

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

for i in range(0,N+1):
    a=10000*i
    if a>Y:
        continue
    for j in range(0,N-i+1):
        a+=5000*j
        if a>Y:
            continue
        for k in range(0,N-i-j+1):
            a+=1000*k
            if 10000*i+5000*j+1000*k==Y:
                print(i," ",j," ",k)
                break
else:
    print(-1,' ',-1,' ',-1)

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

for i in range(0,N+1):
    a=10000*i
    if a>Y:
        continue
    for j in range(0,N-i+1):
        a+=5000*j
        if a>Y:
            continue
        for k in range(0,N-i-j+1):
            a+=1000*k
            if 10000*i+5000*j+1000*k==Y:
                print(i," ",j," ",k)
                break
else:
    print(-1,' ',-1,' ',-1)
Problem p02801 (python)

Fixed submission:
import sys
alp = "abcdefghijklmnopqrstuvwxyza"
C = input()
for i in range(26):
    if alp[i] == C:
        print(alp[i+1])
        sys.exit()

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
AC = set()
wa = [0] * (N+1)

for _ in range(M):
    p, s = input().split()
    p = int(p)
    if not p in AC:
        if s == 'AC':
            AC.add(p)
        if s == 'WA':
            wa[p] += 1

wa_ans = 0
for i in range(1,N+1):
    if i in AC:
        wa_ans += wa[i]

print(len(AC), wa_ans)
Problem p03240 (python)

Fixed submission:
N = int(input())
X = []
Y = []
hh = []
vec = list()
G = (-1,-1,-1)

for _ in range(N):
    x, y, h = map(int, input().split())
    X.append(x)
    Y.append(y)
    hh.append(h)
    # 高さが1以上の三組を一つ取る(この場合, hi = H - |Xi - Cx| - |Yi - Cy|が成立する)
    if h >= 1:
        G = (x, y, h)

for i in range(0,101):
    for j in range(0,101):
        # 最初にHを固定する
        H = G[2] + abs(G[0] - i) + abs(G[1] - j)
        H = max(H, 0)
        flag = True
        for k in range(N):
            key = H - abs(X[k] - i) - abs(Y[k] - j)
            key = max(key, 0)
            if key != hh[k]:
                flag = False
        # 全てのkについてHが成立するとき, append
        if flag:
            vec.append((i,j,H))

if len(vec) == 1:
    print(vec[0][0], vec[0][1], vec[0][2])

Buggy submission (verdict: Runtime Error):
N = int(input())
X = []
Y = []
hh = []
for _ in range(N):
    x, y, h = map(int, input().split())
    X.append(x)
    Y.append(y)
    hh.append(h)

Hmax = float("inf")
allZero = True
for i in range(0,101):
    for j in range(0,101):
        s = set()
        for k in range(N):
            key = abs(X[k] - i) + abs(Y[k] - j) + hh[k]
            if h == 0:
                # H <= abs(X[k]-i) + abs(Y[k]-j)であることがわかる
                Hmax = min(abs(X[k]-i) + abs(Y[k]-j), Hmax)
            else:
                allZero = False
                s.add(key)
        if len(s) == 1:
            H = key
            Cx = i
            Cy = j

if allZero:
    print(Hmax)
else:
    print(Cx, Cy, H)
Problem p03351 (python)

Fixed submission:
a,b,c,d = map(int,input().split())
print('Yes' if abs(b-a) <= d and abs(c-b) <= d or abs(c-a) <= d else 'No')

Buggy submission (verdict: Runtime Error):
X = int(input())
a = 1
for i in range(1,X):
    for j in range(2,X):
        if i**j <= X:
            a = max(a,i**j)
        else:
            break

print(a)
Problem p03352 (python)

Fixed submission:
X = int(input())
a = 1
for i in range(1,X):
    for j in range(2,X):
        if i**j <= X:
            a = max(a,i**j)
        else:
            break

print(a)

Buggy submission (verdict: Runtime Error):
X = int(input())
List =[]
for i in range(33):
    if i >= X:
        break
    for j in range(2,11):
        if i**j < X :
            pass
        elif i**j == X:
            List.append(i**j)
            break
        else:
            List.append(i**(j-1))
            break
print(max(List))
Problem p03377 (python)

Fixed submission:
a,b,x = map(int,input().split())
print('YES' if a <= x <= (a+b) else 'NO')

Buggy submission (verdict: Runtime Error):
n,m,x=map(int,input().split())
s=sum(int(i)<x for i in input().split())
print(min(s,m-s))
Problem p03378 (python)

Fixed submission:
n,m,x=map(int,input().split())
s=sum(int(i)<x for i in input().split())
print(min(s,m-s))

Buggy submission (verdict: Runtime Error):
n,m,x = map(int,input().split())
a = input().split()
a += str(x) 
b = sorted(a).index(str(x))
if b <= (len(a)-1-b):
    print(b)
else:
    print(len(a)-1-b)

Buggy submission (verdict: Runtime Error):
N,M,X = map(int, input().split())
a = input().split()
a += str(X) 
b = sorted(a).index(str(X))
if b <= (len(a)-1-b):
    print(b)
else:
    print(len(a)-1-b)

Buggy submission (verdict: Runtime Error):
N,M,X = map(int, input().split())
a = input().split()
a += str(X) 
b = sorted(a).index(str(X))
if b <= (len(a)-1-b):
    print(b)
else:
    print(len(a)-1-b)
Problem p03416 (python)

Fixed submission:
a,b = map(int,input().split())
c = 0
for i in range(a,b+1):
    if str(i) == str(i)[::-1]:
        c +=1   
print(c)

Buggy submission (verdict: Runtime Error):
31415 92653
Problem p02705 (python)

Fixed submission:
R=input()
R=int(R)
c=R*(44/7)
print(c)

Buggy submission (verdict: Runtime Error):
R=input(int())
R=R*2*(22/7)
print(R,end="")
Problem p02700 (python)

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

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

while True:
  c -= b
  if c <= 0:
    print('Yes')
    break
  
  a -= d
  if a <= 0:
    print('No')
    break

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

a, b, c, d = map(int, input().slice())

while True:
  c -= b
  if c <=0:
    print('Yes')
    break
  a -= d
  if a <= 0:
    print('No')
    break
Problem p02988 (python)

Fixed submission:
n=int(input())
p=[int(i) for i in input().split()]
ans=0
for x in range(1,n-1):
    a=p[x-1]
    b=p[x]
    c=p[x+1]
    if a<b<c or c<b<a:
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
p=[int(i) for i in input().split()]
ans=0
for x in range(2,n):
    a=p[x-1]
    b=p[x]
    c=p[x+1]
    if a<b<c or c<b<a:
        ans+=1
print(ans)
Problem p02993 (python)

Fixed submission:
s=input()
if int(s[0])==int(s[1]) or int(s[1])==int(s[2]) or int(s[2])==int(s[3]):
    print("Bad")
else:
    print("Good")

Buggy submission (verdict: Runtime Error):
s=[int(i) for i in input().split()]
if s[1]==s[2] or s[2]==s[3] or s[3]==s[4]:
    print("Bad")
else:
    print("Good")
Problem p03434 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
A_sort=sorted(A)
Alice=[]
Bob=[]
if N%2==0:
    for i in range(int(N/2)):
        Alice.append(A_sort[2*i+1])
        Bob.append(A_sort[2*i])
else:
    for i in range(int(N/2+1)):
        Alice.append(A_sort[2*i])
    for i in range(int(N/2)):
        Bob.append(A_sort[2*i+1])
Alice_sum=sum(Alice)
Bob_sum=sum(Bob)
ans=Alice_sum-Bob_sum
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[map(int,input().split())]
A_sort=sorted(A)
Alice=[]
Bob=[]
if N%2==0:
    for i in range(int(N/2)):
        Alice.append(A_sort(2*i+1))
        Bob.append(A_sort(2*i))
else:
    for i in range(int(N/2+1)):
        Alice.append(A_sort(2*i))
    for i in range(int(N/2)):
        Bob.append(A_sort(2*i+1))
Alice_sum=sum(Alice)
Bob_sum=sum(Bob)
ans=Alice_sum-Bob_sum
print(ans)
Problem p02584 (python)

Fixed submission:
x, k, d = input().split()
x = int(x)
k = int(k)
d = int(d)
x = abs(x)
if x > d:
  if  x // d > k:
    x = x - k*d
    print(x)
    exit()
  else:
  	k -= x // d
  	x = x % d
    
    
if k % 2 == 1:
  x = abs(x-d)

print(x)

Buggy submission (verdict: Runtime Error):
x, k, d = input().split()
x = int(x)
k = int(k)
d = int(d)
x = abs(x)
if x > d:
  if  x // d > k:
    x = x - k*d
    print(x)
    exit()
  else:
  	k -= x // d
    x = x % d
    
    
if k % 2 == 1:
  x = abs(x-d)

print(x)
Problem p02687 (python)

Fixed submission:
s = input()
if s == 'ARC':
  print('ABC')
else:
  print('ARC')

Buggy submission (verdict: Runtime Error):
s = inpu()
if s == 'ARC':
  print('ABC')
else:
  print('ARC')
Problem p02706 (python)

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

c = 0
for i in range(n):
  c += p[i]
  
if c > a:
  print(-1)
else:
  print(a-c)

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

c = 0
for i in range n:
  c += p[i]
  
if c > a:
  print(-1)
else:
  print(a-c)
Problem p02718 (python)

Fixed submission:
n, m = input().split()
n = int(n)
m = int(m)
c=0

a = list(map(int, input().split()))
for i in range(n):
  c += a[i]
v = c/(4*m)
a.sort(reverse = True)
if a[m-1] < v:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
n, m = input().split()
n = int(n)
m = int(m)
c=0
for i in range(n):
  c += a[i]
v = c/(4*m)
a = list(map(int, input().split()))
a.sort(reverse = True)
if a[m-1] < v:
  print('No')
else:
  print('Yes')