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

Fixed submission:
L =int(input())

if L == 1:
    print('0.037036926')
elif L==2:
     print('0.296296074')
else:
    ans =0
    for i in range(100000):
        ans =max(ans, i/100*i/100*(L-(i/100+i/100)))
    print(ans)

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

if L == 1:
    print('0.037036926')
elif L==2:
     print('0.296296074')
else:
    ans =0
    for i in range(2000):
        for j in range(2000):
            ans =max(ans, i/2*j/2*(L-(i/2+j/2)))
    print(ans
Problem p02755 (python)

Fixed submission:
import math

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

cnt = 0
for i in range(1,100000):
    X = math.floor(i * 0.08)
    Y = math.floor(i * 0.1)
    if A == X and B == Y:
        print(i)
        cnt += 1
        break
        
if cnt == 0:
    print(-1)

Buggy submission (verdict: Runtime Error):
import math
​
A, B = list(map(int,input().split()))
​
cnt = 0
for i in range(1,10000):
    X = math.floor(i * 0.08)
    Y = math.floor(i * 0.1)
    if A == X and B == Y:
        print(i)
        cnt += 1
        break
​
if cnt == 0:
    print(-1)
Problem p02780 (python)

Fixed submission:
from itertools import accumulate

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

A = []
for i in P:
    A.append(1/2*(i+1))
    #A.append(1/2*i*(i+1)/i)

ans = 0
'''
for i in range(len(A)):
    ans = max(ans,sum(A[i:i+K]))
'''
    
accum = [0] + list(accumulate(A))
for i in range(len(accum)):
    ans = max(ans,accum[i] - accum[i-K])
print(ans)

Buggy submission (verdict: Runtime Error):
N,K = list(map(int,input().split()))
P = list(map(int,input().split()))
A =[]
for i in range(N):
    A.append(P[i]+1)
from itertools import accumulate
A= list(accumulate(A))
#print(A)
B=[]
for i in range(K,N):
    B.append((A[i]-A[i-K])/2)
print(max(B))
Problem p02786 (python)

Fixed submission:
H = int(input())
cnt = H
ans = 0
B = [H]

if H == 1:
    ans == 'NA'
else:
    for i in range(100000000000):
        cnt = cnt//2
        B.append(cnt)
        if cnt == 1:
            break

C =[1]
for i in range(1,1001):
    C.append(C[i-1]*2)

if ans == 'NA':
    print('0')
else:
    for i in range(len(B)):
        ans +=C[i]
print(ans)

Buggy submission (verdict: Runtime Error):
H = int(input())
cnt = H
B = [H]

if H == 1:
    ans == 10000000001
else:
    for i in range(100000000000):
        cnt = cnt//2
        B.append(cnt)
        if cnt == 1:
            break

C =[1]
for i in range(1,1001):
    C.append(C[i-1]*2)

if ans == 10000000001:
    print('0')
else:
    ans= 0
    for i in range(len(B)):
        ans +=C[i]
print(ans)

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

cnt = H
B = [H]
if H == 1:
    print('0')
else:
    for i in range(100000000000):
    cnt = cnt//2
    B.append(cnt)
    if cnt == 1:
        break
    C =[1]
    for i in range(1,1001):
        C.append(C[i-1]*2)
    ans= 0
    for i in range(len(B)):
        ans +=C[i]
    print(ans)

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

cnt = H
B = [H]
for i in range(1000):
    cnt = cnt//2
    B.append(cnt)
    if cnt == 1:
        break

C =[1]
for i in range(1,100):
    C.append(C[i-1]*2)

ans= 0
for i in range(len(B)):
    ans +=C[i]
print(ans)
Problem p02983 (python)

Fixed submission:
L,R = list(map(int, input().split()))

if R - L > 2019:
    print("0")
else:
    A =[]
    for i in range(L ,R):
            for j in range(L+1,R+1):
                b = i*j % 2019
                A.append(b)
    ans = min(A) 
    print(ans)

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

if R - L> 2019:
    print("0")
else:
    A =[]
    for i in range(L ,R):
            for j in range(L+1,R+1):
                b = i*j % 2019
                A.append(b)
ans = min(A) 
print(ans)
Problem p03000 (python)

Fixed submission:
import sys

def main():
    N, X = map(int, input().split())
    A = list(map(int, input().split()))
    cnt = 1
    D = 0
    for a in A:
        D += a
        if D > X:
            break
        cnt += 1

    return cnt

if __name__ == '__main__':
    print(main())

Buggy submission (verdict: Runtime Error):
mport sys

def main():
    N, X = map(int, input().split())
    A = list(map(int, input().split()))
    cnt = 1
    D = 0
    for a in A:
        D += a
        if D > X:
            break
        cnt += 1

    return cnt

if __name__ == '__main__':
    print(main())
Problem p03251 (python)

Fixed submission:
N, M, X, Y =list(map(int,input().split()))
x = [i for i in map(int, input().split())]        
y =[i for i in map(int, input().split())]
x_max =max(x)
y_min =min(y)

# X<Z<=Y を満たす数を列挙
for Z in range(X+1,Y+1):

  # x1, x2, ... , xn < Z <= y1, y2, ... , yn の判定
  if x_max<Z and Z<=y_min:
    print('No War')
    exit()

# 条件を満たすZが存在しない場合
print('War')

Buggy submission (verdict: Runtime Error):
N, M, X, Y =list(map(int,input().split()))
a =max( [i for i in map(int, input().split())])                
b =min([i for i in map(int, input().split())])

for z in range(-101,101):
    if (x <= z <= y) and (a < z) and (b >= z):
        cnt +=1
        break

if cnt > 1:
    print('No War')
else:
    print('War')
Problem p03262 (python)

Fixed submission:
#import math
import fractions
from functools import reduce

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

B = []
for i in range(N):
    B.append(abs(X- A[i]))

#最大公約数    
def gcd_list(numbers):
    #return reduce(math.gcd, numbers)
    return reduce(fractions.gcd, numbers)

print(gcd_list(B))

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

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

B = []
for i in range(N):
    B.append(abs(X- A[i]))

def gcd_list(numbers):
    return reduce(math.gcd, numbers)
print(min(min(B),gcd_list(B)))

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

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

B = []
for i in range(N):
    B.append(abs(X- A[i]))

def gcd_list(numbers):
    return reduce(math.gcd, numbers)
print(max(min(B),gcd_list(B)))

Buggy submission (verdict: Runtime Error):
N, X = map(int, input().split())
A = list(map(int,input().split()))
​
B = []
for i in range(N):
    B.append(abs(X- A[i]))
print(min(B))
Problem p03274 (python)

Fixed submission:
N, K = list(map(int,input().split()))
A = list(map(int,input().split()))
P = [0] + [abs(i) for i in A if i> 0 ]
M = [abs(i) for i in A if i< 0 ] +[0]
M = sorted(M,reverse =False)


cnt = 10000000000

if len(P) == len(M) == 1:
    cnt = 0
elif len(P) == 1:
    cnt = M[K]
elif len(M) == 1:
    cnt = P[K]
else:
    #リストがK以下の場合不具合が起きる
    #for i in range(1,K):   
    #len(P)=4 len(M)=3 K=5の場合、IndexErrorとなる。rangeをうまく設定する必要があるが実装できない。
    #正の方向でi個ろうそくを通って、負の方向にK-i個ろうそくを通る
    s = max(0,K-len(M)+1)
    e = min(K+1, len(P))
    for i in range(s, e):
        cnt =min(cnt,P[i]*2 + M[K-i])
    #負の方向でi個ろうそくを通って、正の方向にK-i個ろうそくを通る
    s1 = max(0,K-len(P)+1)
    e1 = min(K+1, len(M))
    for i in range(s1, e1):
        cnt =min(cnt,M[i]*2 + P[K-i])

print(cnt)

Buggy submission (verdict: Runtime Error):
N, K = list(map(int,input().split()))
A = list(map(int,input().split()))
P = [0] + [abs(i) for i in A if i> 0 ]
M = [abs(i) for i in A if i< 0 ] +[0]
M = sorted(M,reverse =False)

cnt = 10000000

if len(P) == len(M) == 1:
    cnt = 0
elif len(P) == 1:
    cnt = M[K]
elif len(M) == 1:
    cnt = P[K]
else:
    #正の部分、負の部分の長さが0の場合エラーが起こる
    #正の方向でi個ろうそくを通って、負の方向にK-i個ろうそくを通る
    for i in range(1,K):
        cnt =min(cnt,P[i]*2 + M[K-i])
        cnt =min(cnt,M[i]*2 + P[K-i])
        #print(cnt)

print(cnt)

Buggy submission (verdict: Runtime Error):
N, K = list(map(int,input().split()))
A = list(map(int,input().split()))
P = [0] + [abs(i) for i in A if i> 0 ]
M = [abs(i) for i in A if i< 0 ] +[0]
M = sorted(M,reverse =False)

cnt = 10000000



#正の部分、負の部分の長さが0の場合エラーが起こる
#正の方向でi個ろうそくを通って、負の方向にK-i個ろうそくを通る
for i in range(1,K):
    cnt =min(cnt,P[i]*2 + M[K-i])
    cnt =min(cnt,M[i]*2 + P[K-i])
    #print(cnt)

print(cnt)

Buggy submission (verdict: Runtime Error):

N, K = list(map(int,input().split()))
A = list(map(int,input().split()))
P = [0] + [abs(i) for i in A if i> 0 ]
M = [abs(i) for i in A if i< 0 ] +[0]
M = sorted(M,reverse =False)

cnt = 10000000
#正の部分、負の部分の長さが0の場合エラーが起こる
#正の方向でi個ろうそくを通って、負の方向にK-i個ろうそくを通る
for i in range(1,K):
    cnt =min(cnt,P[i]*2 + M[K-i])
    #print(cnt)
#負の方向でi個ろうそくを通って、正の方向にK-i個ろうそくを通る
for i in range(1,K):
    cnt =min(cnt,M[i]*2 + P[K-i])
    #print(cnt)

print(cnt)

Buggy submission (verdict: Runtime Error):
N, K = list(map(int,input().split()))
A = list(map(int,input().split()))
P = [0] + [abs(i) for i in A if i> 0 ]
M = [abs(i) for i in A if i< 0 ] +[0]
M = sorted(M,reverse =False)

PP = []
for i in range(len(P)-1):
    PP.append(P[i+1] - P[i])

MM = []
for i in range(len(M)-1):
    MM.append(M[i+1] - M[i])

cnt = 10000000
#正の部分、負の部分の長さが0の場合エラーが起こる
#正の方向でi個ろうそくを通って、負の方向にK-i個ろうそくを通る
for i in range(1,K):
    cnt =min(cnt,P[i]*2 + sum(MM[0:K-i]))
    #print(cnt)
#負の方向でi個ろうそくを通って、正の方向にK-i個ろうそくを通る
for i in range(1,K):
    cnt =min(cnt,M[i]*2 + sum(PP[0:K-i]))
    #print(cnt)

print(cnt)
Problem p03282 (python)

Fixed submission:
S = list(input())
K = int(input())

for i in range(K):
    if S[i] != '1':
        ans = S[i]
        break
    else:
        ans = 1
        continue
print(ans)

Buggy submission (verdict: Runtime Error):
S = list(input())
K = int(input())

for i in range(K):
    if S[i] != '1':
        ans = s
        break
    else:
        ans = 1
        continue
print(ans)

Buggy submission (verdict: Runtime Error):
S = list(input())
K = int(input())

for s in S:
    if s != '1':
        ans = s
        break
    else:
        continue
print(ans)
Problem p03293 (python)

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

s = list(S)
ans = 0

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

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

Buggy submission (verdict: Runtime Error):
S =input()
T = input()

s = list(S)
ans = 0

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

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

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

n = []
for i in range(1,1001):
    if D == 0:
        if i % 100 !=0:
            n.append(i)
        continue
    elif D == 1:
        if i % 100 !=0:
            n.append(100*i)
        continue      
    elif D == 2:
        if i % 100 !=0:
            n.append(10000*i)
        continue
print(n[N-1])

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

if D == 0:
    ans = N
elif D == 1:
    ans ==100 * N
elif D == 2:
    ans ==10000 * N

print(ans)

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

n = []
for i in range(1,100):
    if D == 0:
        n.append(i)
    elif D == 1:
        n.append(100*i)
    elif D == 2:
        n.append(1000*i)
#print(n)

print(n[N-1])
Problem p03361 (python)

Fixed submission:
H, W = map(int, input().split())

#H x Wのマスを全て"."の行列で覆う （H+2 x W+2） 
S1 = [list(map(str,input())) for i in range(H)]
for i in range(H):
    S1[i].insert(0,'#')
    S1[i].append('#')
S = S = [['#'] * (W + 2)] + S1 + [['#'] * (W + 2)]

cnt = 0

for i in range(1,H):
    for j in range(1,W):
        if S[i][j] == '#':
            if S[i-1][j] == S[i][j-1] == S[i][j+1] == S[i+1][j] == '.':
                cnt += 1
if cnt == 0:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
S = [list(map(str,input())) for i in range(H)]

#1.角の黒マス（２マスと接している）が白で囲まれている場合
if S[0][0] == '#' and S[0][1] == S[1][0] == '.':
    print('No')
elif S[0][H-1] == '#' and S[0][H-2] == S[1][H-1] == '.':
    print('No')
elif S[W-1][0] == '#' and S[W-2][0] == S[W-1][1] == '.':
    print('No')
elif S[W-1][H-1] == '#' and S[W-2][H] == S[W][H-2] == '.':
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
S = [list(map(str,input())) for i in range(H)]

if S[0][0] == '#' and S[0][1] == S[1][0] == '.':
    print('No')
elif S[0][H-1] == '#' and S[0][H-2] == S[1][H-1] == '.':
    print('No')
elif S[W-1][0] == '#' and S[W-2][0] == S[W-1][1] == '.':
    print('No')
elif S[W-1][H-1] == '#' and S[W-2][H] == S[W][H-2] == '.':
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
S = [list(map(str,input())) for i in range(H)]

#4隅が黒で両隣が白の場合、達成不可能
if S[0][0] == '#' and S[0][1] == S[1][0] == '.':
    print('No')
elif S[0][H-1] == '#' and S[0][H-2] == S[1][H-1] == '.':
    print('No')
elif S[W-1][0] == '#' and S[W-2][0] == S[W-1][1] == '.':
    print('No')
elif S[W-1][H-1] == '#' and S[W-2][H] == S[W][H-2] == '.':
    print('No')
else:
    print('Yes')
Problem p03409 (python)

Fixed submission:
from operator import itemgetter

N = int(input())
Red = [list(map(int,input().split())) for _ in range(N)] #赤
Blue = [list(map(int,input().split())) for _ in range(N)] #青

Red1 = sorted(Red, key=itemgetter(1),reverse = True)
Blue1 = sorted(Blue, key=itemgetter(0)) #ここが違った
cnt = 0

for i in range(N): 
    for j in range(N):
        if (Blue1[i][0] > Red1[j][0]) and (Blue1[i][1] > Red1[j][1]):
            cnt+=1
            Red1[j] = [500,500] #これがなかった
            #print(B1[i],A1[j])
            break #これがなかった
print(cnt)

Buggy submission (verdict: Runtime Error):
from operator import itemgetter

N = int(input())
Red = [list(map(int,input().split())) for _ in range(N)] #赤
Blue = [list(map(int,input().split())) for _ in range(N)] #青

Red1 = sorted(A, key=itemgetter(1),reverse = True)
Blue1 = sorted(B, key=itemgetter(0)) #ここが違った
cnt = 0

for i in range(N): 
    for j in range(N):
        if (Blue1[i][0] > Red1[j][0]) and (Blue1[i][1] > Red1[j][1]):
            cnt+=1
            Red1[j] = [500,500] #これがなかった
            #print(B1[i],A1[j])
            break #これがなかった
print(cnt)
Problem p03471 (python)

Fixed submission:
n,y = map(int,input().split())

ans = 0
for i in range(2001):
    if ans != 0:
        break
    else:
        for j in range(2001-i):
            if (10000*i + 5000*j + 1000*(n-(i + j))) == y and ((n-(i + j)) >=0):       
                print(i,j,n-(i + j))
                ans +=1
            else:
                continue
                
if ans == 0:
    print('-1','-1','-1')

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

ans = 0
for i in range(1000):
    if ans != 0:
        break
    else:
        for j in range(1000):
            for k in range(1000):
                if (i + k + j)== n and (10000*i + 5000*j + 1000*k) == y:
                    print(i,j,k)
                    ans +=1
                else:
                    continue
                
if ans == 0:
    print('-1','-1','-1')
Problem p03503 (python)

Fixed submission:
n = int(input())
arr = [list(map(int, input().split())) for i in range(n)]
arm = [list(map(int, input().split())) for j in range(n)]  # 入力

ans = -9999999999  # 最小
for item in range(1, 1024):  # 2 ** 10 == 1024
    fund = 0
    for i in range(n):  # 店の数
        cou = 0  # かぶる数
        for x in range(10):  # 月-金(5) * 2
            if (item >> x) % 2 == 1 and arr[i][x] == 1:  # その時間で被るかどうか
                cou += 1
        fund += arm[i][cou]
    ans = max(ans, fund)  # 最大値更新

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input()) 
f = [list(map(int, input().split())) for i in range(n)] 
p = [list(map(int, input().split())) for j in range(n)] 

ans = -9999999999

for i in range(1, 1024): 
    bf = 0  
    for j in range(n):  
        cnt = 0 
        for k in range(10): 
            if (i >> k) & 1 == 1 and f[j][k] == 1: 
                cnt += 1 
        bf += p[j][cnt] 
    ans =max(ans, bf)  　
    
print(ans)
Problem p03625 (python)

Fixed submission:
from collections import Counter
from operator import itemgetter

N = int(input())
A = Counter(map(int,input().split()))
A1 = list(A.items())
A1 = sorted(A1,key=itemgetter(1),reverse = True)
A1 = sorted(A1,key=itemgetter(0),reverse = True)
#print(A1)

#正方形の場合
B =[]
for i in range(len(A1)):
    if A1[i][1] > 3:
        B.append(A1[i][0])
        if len(B) == 1:
            break
C =[]
for i in range(len(A1)):
    if A1[i][1] > 1:
        C.append(A1[i][0])
        if len(C) == 2:
            break

if len(C) == 0:
    print(0)
elif len(B) !=0:
    print(max(B[0]*B[0],C[0]*C[1]))
else:
    print(C[0]*C[1])

Buggy submission (verdict: Runtime Error):
from collections import Counter
from operator import itemgetter

N = int(input())
A = list(map(int,input().split())) + [0]
A = list(Counter(A).items())
A  = sorted(A,key=itemgetter(1),reverse = True)
A  = sorted(A,key=itemgetter(0),reverse = True)
#print(A)
ans = 0
for i in range(len(A)):
    if A[i][1] > 1:
        if A[i][1] > 3 :
            ans = max(ans,A[i][0]*2)
        if A[i][1] > 1 and A[i+1][1] > 1:
            ans = max(ans ,A[i][0]*A[i+1][0])
print(ans

Buggy submission (verdict: Runtime Error):
from collections import Counter
from operator import itemgetter

N = int(input())
A = Counter(map(int,input().split()))
A1 = list(A.items())
A1 = sorted(A1,key=itemgetter(1),reverse = True)
A1 = sorted(A1,key=itemgetter(0),reverse = True)
#print(A1)

#正方形の場合
B =[]
for i in range(len(A1)):
    if A1[i][1] > 3:
        B.append(A1[i][0])
        if len(B) == 1:
            break
C =[]
for i in range(len(A1)):
    if A1[i][1] > 1:
        C.append(A1[i][0])
        if len(C) == 2:
            break

if len(C) == 0:
    print(0)
else:
    print(max(B[0]*2,C[0]*C[1]))

Buggy submission (verdict: Runtime Error):
from collections import Counter
from operator import itemgetter

N = int(input())
A = Counter(map(int,input().split()))
A1 = list(A.items())
A1 = sorted(A1,key=itemgetter(1),reverse = True)
A1 = sorted(A1,key=itemgetter(0),reverse = True)
#print(A1)

B =[]
for i in range(len(A1)):
    if A1[i][1] > 1:
        B.append(A1[i][0])
        if len(B) == 2:
            break
print(B[1]*B[2] if len(B) !=0 else 0)
Problem p03633 (python)

Fixed submission:
#import math  
import fractions
from functools import reduce

N = int(input())
T = []
for i in range(N):
    T.append(int(input()))

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
ans = lcm_list(T)

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
t = [int(input()) for i in range(n)]


def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


print(lcm_list(t))

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

N = int(input())
T = []
for i in range(N):
    T.append(int(input()))

def lcm_base(x, y):
    return (x * y) // functools.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
ans = lcm_list(T)

print(ans)

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

N = int(input())
T = []
for i in range(N):
    T.append(int(input()))

def lcm_base(x, y):
    return (x * y) // functools.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
ans = lcm_list(T)

print(ans)

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

N = int(input())
T = []
for i in range(N):
    T.append(int(input()))

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
ans = lcm_list(T)

print(ans)
Problem p02768 (python)

Fixed submission:
M = 10**9 + 7
n,a,b = map(int, input().split())

def modinv(n):
    return pow(n, M-2, M)

def comb(n, r):
    num = 1
    for i in range(n,n-r,-1):
        cur = i
        while cur%M == 0:
            cur //= M
        num = (num*cur)%M

    denom = 1
    for i in range(1,r+1):
        cur = i
        while cur%M == 0:
            cur //= M
        denom = (denom*cur)%M

    return num * modinv(denom) % M


print((pow(2, n, M) - comb(n, a) - comb(n, b) - 1) % M)

Buggy submission (verdict: Runtime Error):
from math import comb

M = 10**9 + 7
n,a,b = map(int, input().split())

print(pow(2, n, M) - comb(n, a) % M - comb(n, b) % M)
Problem p03351 (python)

Fixed submission:
import math

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

if math.fabs(a - c) <= d:
  print("Yes")
elif math.fabs(a - b) <= d and math.fabs(b - c) <= d:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import math

a, b, c, d = list(map(int, input()))

if math.fabs(a - c) <= d:
  print("Yes")
elif math.fabs(a - b) <= d and math.fabs(b - c) <= d:
  print("Yes")
else:
  print("No")
Problem p03473 (python)

Fixed submission:
hour = int(input())

print(48 - hour)

Buggy submission (verdict: Runtime Error):
date = input()
date = list(date)
date[3] = '8'
date = ''.join(date)
print(date)
Problem p03543 (python)

Fixed submission:
import sys

integer = list(map(int, str(input())))

for i in range(10):
  if integer[0:3] == [i, i, i] or integer[1:4] == [i, i, i] or integer[0:4] == [i, i, i, i]:
    print("Yes")
    sys.exit()

print("No")

Buggy submission (verdict: Runtime Error):
import sys

#integer = list(map(int, str(input())))
integer = list(map(int, str(sys.argv[1])))

print(integer)
for i in range(10):
  if integer.count(i) >= 3:
    print("Yes")
    sys.exit()

print("No")
Problem p03547 (python)

Fixed submission:
x, y = list(input().split())

if x > y:
  print(">")
elif x == y:
  print("=")
else:
  print("<")

Buggy submission (verdict: Runtime Error):
x, y = list(input().split(" "))
if int(x, 16) > int(y, 16):
    print(">")
elif hex(x, 16) < hex(y, 16):
    print("<")
else:
    print("=")
Problem p03555 (python)

Fixed submission:
strlist1 = input()
strlist2 = input()

flag = True

for i in range(3):
  if strlist1[i] != strlist2[2 - i]:
    flag = False

if flag:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
strlist1 = input()
strlist2 = input()

flag = True

for i in range(3):
  if strlist1[i] != strlist2[2 - i]:
    flag = false

if flag:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
strlist1 = input()
strlist2 = input()
print(strlist1)
print(strlist2)

flag = true

for i in range(3):
  if strlist1[i] != strlist2[2 - i]:
    flag = false

if flag:
  print("YES")
else:
  print("NO")
Problem p03563 (python)

Fixed submission:
r = int(input())
g = int(input())

print(2 * g - r)

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int r, g;
  cin >> r >> g;
  cout << 2 * g - r << endl;
  return 0;
}

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = 0; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main() {
  int r, g;
  cin >> r >> g;
  cout << 2 * g - r << endl;
  return 0;
}

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = 0; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main() {
  int r, g;
  cin >> r >> g;
  cout << 2 * g - r << endl;
  return 0;
}
Problem p03623 (python)

Fixed submission:
import math

x, a, b = list(map(int, input().split()))

if math.fabs(x - a) > math.fabs(x - b):
  print("B")
else:
  print("A")

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

if math.fabs(x - a) > math.fabs(x - b):
  print("B")
else:
  print("A")