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

Fixed submission:
A,B = (int(i) for i  in input().split())
from math import sqrt
from fractions import gcd
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors
divisors = make_divisors(gcd(A,B))
def is_prime(n):
    if n == 1: return True
    for k in range(2, int(sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True
ans = 0
for d in divisors:
    ans += is_prime(d)
print(ans)

Buggy submission (verdict: Runtime Error):
A,B = (int(i) for i  in input().split())
from math import gcd,sqrt
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors
divisors = make_divisors(gcd(A,B))
def is_prime(n):
    if n == 1: return True
    for k in range(2, int(sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True
ans = 0
for d in divisors:
    ans += is_prime(d)
print(ans)

Buggy submission (verdict: Runtime Error):
A,B = (int(i) for i  in input().split())
from math import gcd,sqrt
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors
divisors = make_divisors(gcd(A,B))
def is_prime(n):
    if n == 1: return True
    for k in range(2, int(sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True
ans = 0
for d in divisors:
    ans += is_prime(d)
print(ans)
Problem p02903 (python)

Fixed submission:
H,W,A,B = map(int,input().split())
import numpy as np
ans = np.array([[0] * W] * H)
for h in range(H):
    for w in range(W):
        if w >= A and h >= B:
            pass
        elif w >= A:
            ans[h,w] = 1
        elif h >= B:
            ans[h,w] = 1
        else:
            pass
for h in range(H):
    a = ans[h].tolist()
    print(*a,sep="")

Buggy submission (verdict: Runtime Error):
H,W,A,B = map(int,input().split())
import numpy as np
ans = np.array([[0] * W] * H)
for h in range(H):
    for w in range(W):
        if w >= A and h >= B:
            pass
        elif w >= A:
            ans[h,w] = 1
        elif h >= B:
            ans[h,w] = 1
        else:
            pass
for h in range(H):
    a = ans[h].tolist()
    print(*a,sep="")
Problem p02921 (python)

Fixed submission:
S = input()
T = input()
cnt = 0
for i in range(len(S)):
    if S[i]==T[i]:
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
cnt = 0
for i in range(len(s)):
    if S[i]==T[i]:
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
cnt = 0
for i in range(len(s)):
    if S[i]==T[i]:
        cnt += 1
print(cnt)
Problem p02947 (python)

Fixed submission:
from scipy.misc import comb
from collections import Counter
N = int(input())
S = [input() for _ in range(N)]
chars = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
result = []
for n in range(N):
    res = {}
    for char in chars:
        res[char] = S[n].count(char)
    result.append(res)
result2 = Counter([str(i) for i in result ])
cnt = 0
for key in result2.keys():
    if result2[key] == 1:
        pass
    else:
        cnt += comb(result2[key],2,exact=True)
print(int(cnt))

Buggy submission (verdict: Runtime Error):
from collections import Counter
N = int(input())
S = [input() for _ in range(N)]
from math import factorial
chars = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
result = []
for n in range(N):
    res = {}
    for char in chars:
        res[char] = S[n].count(char)
    result.append(res)
result2 = Counter([str(i) for i in result ])
cnt = 0
for key in result2.keys():
    if result2[key] == 1:
        pass
    else:
        comb = factorial(result2[key]) / factorial(2) / factorial(result2[key] - 2)
        cnt += comb
print(int(cnt))
Problem p02960 (python)

Fixed submission:
rotate = lambda x,y: x[-y:] + x[:-y]
S = input()
mod = 13
amari = 5
dp_tmp = [0]*13
dp_tmp[0] = 1
mul = 1
for s in S[::-1]:
    dp = [0]*13
    if s == "?":
        for n in range(10):
            dp_tmp_roll = rotate(dp_tmp,n*mul%mod)
            for k in range(13):
                dp[k] += dp_tmp_roll[k]
    else:
        dp_tmp_roll = rotate(dp_tmp,int(s)*mul%mod)
        for k in range(13):
            dp[k] += dp_tmp_roll[k]
    for n in range(13):
        dp[n] = dp[n]%(10**9+7)
    dp_tmp = dp
    mul = mul*10%13
print(dp[amari])

Buggy submission (verdict: Runtime Error):
%%time
from copy import deepcopy
rotate = lambda x,y:x[y:] + x[:y]
S = input()
mod = 13
amari = 5

dp_tmp = [0]*13
dp_tmp[0] = 1
for i,s in enumerate(S[::-1]):
    dp = [0]*13
    if s == "?":
        for n in range(10):
            dp_tmp_roll = rotate(dp_tmp,n*(10**i)%mod)
            for i in range(13):
                dp[i] += dp_tmp_roll[i]
    else:
        dp_tmp_roll = rotate(dp_tmp,int(s)*(10**i)%mod)
        for i in range(13):
            dp[i] += dp_tmp_roll[i]
    for n in range(13):
        dp[n] = dp[n]%(10**9+7)
    dp_tmp = deepcopy(dp)
print(dp[amari])

Buggy submission (verdict: Runtime Error):
S = input()
mod = 13
amari = 5

import numpy as np
dp = np.zeros((len(N)+1,mod),dtype="uint64")
dp[0,0%mod] = 1
for i,s in enumerate(S):
    if s == "?":
        for n in range(10):
            dp[i+1,:] += np.roll(dp[i],n*(10**i)%mod)
    else:
        dp[i+1,:] += np.roll(dp[i],int(s)*(10**i)%mod)
    dp = dp%(10**9+7)
print(dp[-1,amari+1])
Problem p02983 (python)

Fixed submission:
L,R = [int(i) for i in input().split()]
mod = 2019
if R-L >= 673:
    print(0)
else:
    ans = []
    for i in range(L,R+1):
        for ii in range(i+1,R+1):
            ans.append((i*ii)%mod)
    ans = sorted(ans)
    print(ans[0])

Buggy submission (verdict: Runtime Error):
L,R = [int(i) for i in input().split()]
if R-L >= 4038:
    print(0)
else:
    ans = []
    for i in range(L,R+1):
        ans.append(i % mod)
    ans = sorted(ans)
    ans2 = (ans[0]*ans[1])%mod
    print(ans2)

Buggy submission (verdict: Runtime Error):
L,R = [int(i) for i in input().split()]
if R-L >= 4038:
    print(0)
else:
    ans = []
    for i in range(L,R+1):
        ans.append(i % mod)
    ans = sorted(ans)
    print(ans[0]*ans[1])
Problem p02988 (python)

Fixed submission:
N = int(input())
P = [int(i)for i in input().split()]
cnt = 0
for n in range(1,N-1):
    if (P[n-1] < P[n] < P[n+1] or P[n-1] > P[n] > P[n+1]):
        cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(N)
P = [int(i) for i in input().split()]
ans = 0
for i in range(N-2):
  if max(P[i:i+3]) != P[i+1] and min(P[i:i+3]) != P[i+1]:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
P = list(input().split())
cnt = 0
for n in range(1,N-1):
     if P[n-1] < P[n] and P[n] < P[n+1]:
        cnt += 1
    elif P[n-1] > P[n] and P[n] > P[n+1]:
        cnt += 1
print(cnt)
Problem p02995 (python)

Fixed submission:
from fractions import gcd
A,B,C,D = map(int,input().split())
C_div = B//C - (A-1)//C
D_div = B//D - (A-1)//D
CD = (C * D) // gcd(C, D)
CD_div = B//CD - (A-1)//CD
print(B-A+1 - C_div - D_div + CD_div)

Buggy submission (verdict: Runtime Error):
from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)
A,B,C,D = map(int,input().split())
if A%C==0 or B%C==0:
    C_div = (B-A+1)//C + 1
else:
    C_div = (B-A+1)//C
if B%C==0 or B%D==0:
    D_div = (B-A+1)//D + 1
else:
    D_div = (B-A+1)//D
if A%(lcm(C,D)) == 0 or B%(lcm(C,D)) == 0:
    CD_div = (B-A+1)//lcm(C,D) + 1
print((B-A+1) - C_div -D_div + CD_div)

Buggy submission (verdict: Runtime Error):
if A%C==0 and A%D==0:
    C_div = (B-A+1)//C + 1
else:
    C_div = (B-A+1)//C
if B%C==0 and B%D==0:
    D_div = (B-A+1)//D + 1
else:
    D_div = (B-A+1)//D
if A%(C*D) == 0 and B%(C*D) == 0:
    CD_div = (B-A+1)//(C*D) + 1
else:
    CD_div = (B-A+1)//(C*D)
if C == 1 or D == 1:
    print(0)
elif C == D:
    print((B-A+1) - C_div)
elif C%D==0 or D%C==0:
    if C > D:
        print((B-A+1) - D_div)
    else:
        print((B-A+1) - C_div)
else:
    print((B-A+1) - C_div -D_div + CD_div)

Buggy submission (verdict: Runtime Error):
if A%C==0 and A%D==0:
    C_div = (B-A+1)//C + 1
else:
    C_div = (B-A+1)//C
if B%C==0 and B%D==0:
    D_div = (B-A+1)//D + 1
else:
    D_div = (B-A+1)//D
if A%(C*D) == 0 and B%(C*D) == 0:
    CD_div = (B-A+1)//(C*D) + 1
else:
    CD_div = (B-A+1)//(C*D)
if C == 1 or D == 1:
    print(0)
else:
    print((B-A+1) - C_div -D_div + CD_div))

Buggy submission (verdict: Runtime Error):
if A%C==0 and A%D==0:
    C_div = (B-A+1)//C + 1
else:
    C_div = (B-A+1)//C
if B%C==0 and B%D==0:
    D_div = (B-A+1)//D + 1
else:
    D_div = (B-A+1)//D
if A%(C*D) == 0 and B%(C*D) == 0:
    CD_div = (B-A+1)//(C*D) + 1
else:
    CD_div = (B-A+1)//(C*D)
if C == 1 or D == 1:
    print(0)
else:
    print((B-A+1) - C_div -D_div + CD_div)
Problem p03006 (python)

Fixed submission:
N = int(input())
XY = []
for n in range(N):
    XY.append([int(i) for i in input().split()])
XY = sorted(XY)
cnt = {}
for n in range(N):
    for nn in range(n+1,N): 
        dist = [XY[n][0]-XY[nn][0],XY[n][1]-XY[nn][1]]
        if str(dist) in cnt:
            cnt[str(dist)] += 1
        else:
            cnt[str(dist)] = 1
if N == 1:
    print(1)
else:
    print(N - max(cnt.values()))

Buggy submission (verdict: Runtime Error):
N = int(input())
XY = []
for n in range(N):
    XY.append([int(i) for i in input().split()])
cnt = {}
for n in range(N):
    for nn in range(n+1,N): 
        dist = [XY[n][0]-XY[nn][0],XY[n][1]-XY[nn][1]]
        if str(dist) in cnt:
            cnt[str(dist)] += 1
        else:
            cnt[str(dist)] = 1
print(N - max(cnt.values()))
Problem p03030 (python)

Fixed submission:
N = int(input())
SP = []
for _ in range(N):
    SP.append([i for i in input().split()])
for n in range(N):
    SP[n][1] = str(100 - int(SP[n][1])).rjust(3,'0')
SP2 = []
for n in range(N):
    SP2.append(SP[n][0]+SP[n][1])
ans = sorted(range(len(SP2)), key=lambda k: SP2[k])
for i in ans:
    print(i+1)

Buggy submission (verdict: Runtime Error):
N = int(input())
SP = []
for _ in range(N):
    SP.append([i for i in input().split()])
for n in range(N):
    SP[n][1] = str(100 - int(SP[n][1])).rjust(3,'0')
SP2 = []
for n in range(N):
    SP2.append(SP[0]+SP[1])
ans = sorted(range(len(SP2)), key=lambda k: SP2[k])
for i in ans:
    print(i+1)

Buggy submission (verdict: Runtime Error):
N = int(input())
SP = []
for _ in range(N):
    SP.append([i for i in input().split()])
for n in range(N):
    SP[n][1] = str(100 - int(SP[n][1])).rjust(3,'0')
SP2 = []
for n in range(N):
    SP2.append(SP[0]+SP[1])
ans = sorted(range(len(SP2)), key=lambda k: SP2[k])
[print(i) for i in ans]

Buggy submission (verdict: Runtime Error):
N = int(input())
SP = []
for _ in range(N):
    SP.append([i for i in input().split()])
for n in range(N):
    SP[n][1] = str(100 - SP[n][1]).rjust(3,'0')
SP2 = []
for n in range(N):
    SP2.append(SP[0]+SP[1])
ans = sorted(range(len(SP2)), key=lambda k: SP2[k])
[print(i) for i in ans]

Buggy submission (verdict: Runtime Error):
N = int(input())
SP = []
for _ in range(N):
  SP.append([i for i in input().split()])
for n in range(N):
  SP[n][1] = str(100 - SP[n]).rjust(3,'0')
SP2 = []
for n in range(N):
  SP2.append(SP[0]+SP[1])
ans = sorted(range(len(SP2)), key=lambda k: SP2[k])
[print(i) for i in ans]

Buggy submission (verdict: Runtime Error):
N = int(input())
SP = []
for _ in range(N):
  SP.append(input().split())
print(sorted(range(len(s)), key=lambda k: s[k],reverse=True))
Problem p03059 (python)

Fixed submission:
import math
[A,B,T] = [int(i) for i in input().split()]
print(B * math.floor(T  / A ))

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

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

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

if N==2:
    print(max(A))
else:
    gcds = []
    for i in range(len(A)-1):
        if i == 0:
            gcds.append(gcd(A[0],A[1]))
        else:
            gcds.append(gcd(gcds[-1],A[i]))
    gcds = np.asarray(gcds)
    
    index = []
    for idx,n in enumerate(gcds.min() == gcds):
        if n==True:
            index.append(idx)
    a = []
    for i in index:
        if i+1 in index:
            None
        else:
            a.append(i+1)
    for i in a:
        index.append(i)
    gcds = []
    for idx in index:
        A_temp = copy.deepcopy(A)
        A_temp.pop(idx)
        gcds_temp = []
        for i in range(len(A_temp)-1):
            if i ==0:
                gcds_temp.append(gcd(A_temp[0],A_temp[1]))
            else:
                gcds_temp.append(gcd(gcds_temp[-1],A_temp[i]))
        gcds.append(min(gcds_temp))
    print(max(gcds))
Problem p03067 (python)

Fixed submission:
X= [int(i) for i in input().split()]
if (X[0] > X[2] and X[1] < X[2]) or (X[0] < X[2] and X[1] > X[2]) :
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [1 if i == "." else 0 for i in input()]
# 黒は#,白が.
# 黒は0,白は1
# 黒の右に白は許されない
# ある場所を境に左は全部白、右は全部黒にするから、それの逆の個数を数える
# ある境より右にある白の数
rw = sum(S)
# ある境より左にある黒の数
lb = 0
min_temp = rw+lb
for idx,s in enumerate(S):
    # 黒の場合
    if s==0:
        # rw pass
        lb *= 1
    # 白の場合
    elif s==1:
        rw += 1
        lb -= 1
    # 小さい方を残す
    min_temp = min([min_temp,rw+lb])
    if min_temp == 0:break
print(min_temp)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
cnt1 = 0
cnt2 = 0
for idx,s in enumerate(S):
    if s == "#" and idx < N-1:
        cnt1+=1
    if s=="." and N!=0:
        cnt2+=1
if cnt1 < cnt2:
    print(cnt1)
else:
    print(cnt2)

Buggy submission (verdict: Runtime Error):
N=int(input())
# S=input()
S = ["#" for i in range(200000)]
S[0] = "."
S = "".join(S)
cnt1 = 0
cnt2 = 0
for idx,s in enumerate(S):
    if s == "#" and idx < N-1:
        cnt1+=1
    if s=="." and N==0:
        cnt2+=1
if cnt1 < cnt2:
    print(cnt1)
else:
    print(cnt2)

Buggy submission (verdict: Runtime Error):
N = int(input())
S=input()
cnt1 = 0
cnt2 = 0
for idx,s in enumerate(S):
    print(idx)
    if s != "." and idx != N-1:
        cnt1 += 1
    if s!="#":
        cnt2+=1
print(min([cnt1,cnt2]))
Problem p03069 (python)

Fixed submission:
N = int(input())
S = [1 if i == "." else 0 for i in input()]
# 黒は#,白が.
# 黒は0,白は1
# 黒の右に白は許されない
# ある場所を境に左は全部白、右は全部黒にするから、それの逆の個数を数える
# ある境より右にある白の数
rw = sum(S)
# ある境より左にある黒の数
lb = 0
min_temp = rw+lb
for idx,s in enumerate(S):
    # 黒の場合
    if s==0:
        # rw pass
        lb += 1
    # 白の場合
    elif s==1:
        rw -= 1
    # 小さい方を残す
    min_temp = min([min_temp,rw+lb])
    if min_temp == 0:break
print(min_temp)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [1 if i == "." else 0 for i in input()]
# 黒は#,白が.
# 黒は0,白は1
# 黒の右に白は許されない
# ある場所を境に左は全部白、右は全部黒にするから、それの逆の個数を数える
# ある境より右にある白の数
rw = sum(S)
# ある境より左にある黒の数
lb = 0
min_temp = [rw+lb]
for idx,s in enumerate(S):
    # 黒の場合
    if s==0:
        # rw pass
        lb *= 1
    # 白の場合
    elif s==1:
        rw += 1
        lb -= 1
    # 小さい方を残す
    min_temp = min([min_temp,rw+lb])
    if min_temp == 0:break
print(min_temp)
Problem p03076 (python)

Fixed submission:
t = [int(input()) for i in range(5)]
T = [(-(-i//10))*10 for i in t]
t_min = [i%10 for i in t]
t_min = min([i for i in t_min if i != 0]) if t_min != [0 for i in range(5)] else 10
print(sum(T) - 10 + t_min)

Buggy submission (verdict: Runtime Error):
t = [int(input()) for i in range(5)]
T = [(-(-i//10))*10 for i in t]
t_min = [i%10 for i in t]
t_min = min([i for i in t_min if i != 0])
print(sum(T) - 10 + t_min)

Buggy submission (verdict: Runtime Error):
t = [int(input()) for i in range(5)]
T = [(-(-i//10))*10 for i in t]
t_min = [i%10 for i in t]
t_min = min([i for i in t_min if i != 0])
print(sum(T) - 10 + t_min)

Buggy submission (verdict: Runtime Error):
t = [int(input()) for i in range(5)]
T = [(-(-i//10))*10 for i in t]
t_min = [i%10 for i in t]
t_min = min([i for i in t_min if i != 0])
sum(T) - 10 + t_min
Problem p03078 (python)

Fixed submission:
[XYZK,A,B,C] = [input() for i in range(4)]
[X,Y,Z,K] = [int(i) for i in XYZK.split()]
A = sorted([int(i) for i in A.split()],reverse=True)[:K]
B = sorted([int(i) for i in B.split()],reverse=True)[:K]
C = sorted([int(i) for i in C.split()],reverse=True)[:K]

ABC = []
for i in range(X):
    if (i + 1) > K:
        break
    for j in range(Y):
        if (i + 1) * (j + 1) > K:
            break
        for l in range(Z):
            if (i + 1) * (j + 1) * (l + 1) > K:
                break
            ABC.append(A[i] + B[j] + C[l])
ABC = sorted(ABC, reverse=True)
print(*ABC[:K])

Buggy submission (verdict: Runtime Error):
X, Y, Z, K = [int(i) for i in input().split()]
A = sorted([int(i) for i in input().split()],reverse=True)
B = sorted([int(i) for i in input().split()],reverse=True)
C = sorted([int(i) for i in input().split()],reverse=True)
def set_tuple(A,B,C,x,y,z):
    return (-(A[x]+B[y]+C[z]),x,y,z)
Q = []
heapq.heappush(Q,set_tuple(A,B,C,0,0,0))
Ans = []
memo = {(0,0,0):True}
for _ in range(K):
    e,x,y,z = heapq.heappop(Q)
    Ans.append(-e)
    if x+1 < X and (x+1,y,z) not in memo:
        heapq.heappush(Q,set_tuple(A,B,C,x+1,y,z))
        memo[(x+1,y,z)] = True
    if y+1 < Y and (x,y+1,z) not in memo:
        heapq.heappush(Q,set_tuple(A,B,C,x,y+1,z))
        memo[(x,y+1,z)] = True
    if z+1 < Z and (x,y,z+1) not in memo:
        heapq.heappush(Q,set_tuple(A,B,C,x,y,z+1))
        memo[(x,y,z+1)] = True
for i in Ans[:K]:print(i)

Buggy submission (verdict: Runtime Error):
X, Y, Z, K = [int(i) for i in input().split()]
A = sorted([int(i) for i in input().split()],reverse=True)
B = sorted([int(i) for i in input().split()],reverse=True)
C = sorted([int(i) for i in input().split()],reverse=True)
def set_tuple(A,B,C,x,y,z):
    return (-(A[x]+B[y]+C[z]),x,y,z)
Q = []
heapq.heappush(Q,set_tuple(A,B,C,0,0,0))
Ans = []
memo = {(0,0,0):True}
for _ in range(K):
    e,x,y,z = heapq.heappop(Q)
    Ans.append(-e)
    if x+1 < X and (x+1,y,z) not in memo:
        heapq.heappush(Q,set_tuple(A,B,C,x+1,y,z))
        memo[(x+1,y,z)] = True
    if y+1 < Y and (x,y+1,z) not in memo:
        heapq.heappush(Q,set_tuple(A,B,C,x,y+1,z))
        memo[(x,y+1,z)] = True
    if z+1 < Z and (x,y,z+1) not in memo:
        heapq.heappush(Q,set_tuple(A,B,C,x,y,z+1))
        memo[(x,y,z+1)] = True
for i in Ans[:K]:print(i)

Buggy submission (verdict: Runtime Error):
[XYZK,A,B,C] = [input() for i in range(4)]
[X,Y,Z,K] = [int(i) for i in XYZK.split()]
A = [int(i) for i in A.split()]
B = [int(i) for i in B.split()]
C = [int(i) for i in C.split()]
Ans = [0 for i in range(K)]
for a in A:
    for b in B:
        for c in C:
            abc = a+b+c
            if min(Ans) < a + b + c:
                Ans[Ans.index(min(Ans))] = a+b+c
Ans = sorted(Ans,reverse=True)
for i in range(Ans):
    print(Ans[i])
Problem p03101 (python)

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

import numpy as np

matrix = np.ones((H,W),dtype="uint8")
matrix[0:r,:] = 0
matrix[:,0:c] = 0
print(matrix.sum())

Buggy submission (verdict: Runtime Error):
H,W = map(int,input())
r,c = map(int,input())

import numpy as np

matrix = np.ones((H,W),dtype="uint8")
matrix[0:r,:] = 0
matrix[:,0:c] = 0
print(matrix.sum())
Problem p03136 (python)

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]
max_A = max(A)
A.remove(max_A)
if sum(A) > max_A:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split()]
max_A = max(A)
if sum(A.remove(max_A)) > max(A):
    print("Yes")
else:
    print("No")
Problem p03238 (python)

Fixed submission:
N = int(input())
if N == 1:
  print("Hello World")
else:
  A = int(input())
  B = int(input())
  print(A+B)

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

if N == 1:
    print("Hello World")
else:
    print(A+B)
Problem p03281 (python)

Fixed submission:
N = int(input())
 
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
 
    return divisors
 
cnt = 0  
for n in range(1,N+1):
    if len(make_divisors(n)) == 8 and n%2==1:
        cnt += 1
print(cnt)

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

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    return divisors

cnt = 0  
for n in range(1,N+1):
  if len(make_divisiors(n)) == 8:
    cnt += 1
print(cnt)
Problem p03323 (python)

Fixed submission:
A,B = map(int,input().split())
if A >= 9 or B >= 9:
    print(":(")
else:
    print("Yay!")

Buggy submission (verdict: Runtime Error):
if A >= 9 or B >= 9:
    print(":(")
else:
    print("Yay!")

Buggy submission (verdict: Runtime Error):
if A => 9 or B => 9 :
    print(":(") 
else: 
    print("Yay!")
Problem p03324 (python)

Fixed submission:
D,N = map(int,input().split())
from math import pow
print(int(pow(100,D) * N)) if N != 100 else print(int(pow(100,D) * 101))

Buggy submission (verdict: Runtime Error):
D,N = map(int,input().split())
from math import pow
print(int(pow(100,D) * N)) if N != 100 elseprint(int(pow(100,D) * 101))
Problem p03494 (python)

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]
import numpy as np

A = np.array(A)

cnt = 0

while True:
    if (A%2).sum() == 0:
        A = A/2
        cnt += 1
    else:
        break
print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split()]
import numpy as np

A = np.array(A)

cnt = 0

while True:
  if (A%2).sum() == 0:
    A = A/2
    cnt += 1
  else
    break
print(cnt)