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

Fixed submission:
#!/usr/bin/env python3
import sys, math, fractions, itertools

def solve(N: int, A: int, x: "List[int]"):
    X = max(x)
    dp = [[[0 for _ in range(max(N*X+1, N*A+1))] for _ in range(N+1) ] for _ in range(N+1)]
    dp[0][0][0] = 1
    for n in range(N+1):
        for m in range(N+1):
            for k in range(N*X+1):
                if n >= 1 and k < x[n-1]:
                    dp[n][m][k] = dp[n-1][m][k]
                elif n >= 1 and m >= 1 and k >= x[n-1]:
                    dp[n][m][k] = dp[n-1][m][k] + dp[n-1][m-1][k-x[n-1]]
    s = 0
    for i in range(1, N+1):
        s += dp[N][i][i*A]
    print(s)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    x = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, A, x)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys, math, fractions, itertools

def solve(N: int, A: int, x: "List[int]"):
    X = max(x)
    dp = [[[0 for _ in range(N*X+1)] for _ in range(N+1) ] for _ in range(N+1)]
    dp[0][0][0] = 1
    for n in range(N+1):
        for m in range(N+1):
            for k in range(N*X+1):
                if n >= 1 and k < x[n-1]:
                    dp[n][m][k] = dp[n-1][m][k]
                elif n >= 1 and m >= 1 and k >= x[n-1]:
                    dp[n][m][k] = dp[n-1][m][k] + dp[n-1][m-1][k-x[n-1]]
    s = 0
    for i in range(1, N+1):
        s += dp[N][i][i*A]
    print(s)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    x = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, A, x)

if __name__ == '__main__':
    main()
Problem p04019 (python)

Fixed submission:
#!/usr/bin/env python3
import sys, math, fractions, itertools, collections, copy, heapq

YES = "Yes"  # type: str
NO = "No"  # type: str

def solve(s: str):
    N = s.count('N')
    S = s.count('S')
    E = s.count('E')
    W = s.count('W')
    if (N == 0 and S != 0) or (N != 0 and S == 0) or (E == 0 and W != 0) or (E != 0 and W == 0):
        print('No')
    else:
        print('Yes')
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)

if __name__ == '__main__':
    main()

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

N = S.count('N')
S = S.count('S')
E = S.count('E')
W = S.count('W')

if N == S and E == W:
  print('Yes')
else:
  print('No')
Problem p02684 (python)

Fixed submission:
n, k = map(int, input().split())
a = [int(x)-1 for x in input().split()]

visited = [0] * n
visited[0] = 1
visit_list = [0]
visit = 0
while True:
    new_visit = a[visit]
    if visited[new_visit] == 1:
        break
    visited[new_visit] = 1
    visit_list.append(new_visit)
    visit = new_visit

period_first_index = visit_list.index(a[visit_list[-1]])
period_list = visit_list[period_first_index:]

if k < len(visit_list):
    print(visit_list[k]+1)
elif k == len(visit_list):
    print(a[visit_list[-1]]+1)
else:
    print(period_list[(k-period_first_index)%len(period_list)]+1)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
a = [int(x)-1 for x in input().split()]

visited = [0] * n
visited[0] = 1
visit_list = [0]
visit = 0
while True:
    new_visit = a[visit]
    if visited[new_visit] == 1:
        break
    visited[new_visit] = 1
    visit_list.append(new_visit)
    visit = new_visit

period_first_index = visit_list.index(a[visit_list[-1]])
period_list = visit_list[period_first_index:]
period = len(visit_list) - period_first_index

if k <= len(visit_list):
    print(visit_list[k]+1)
else:
    print(period_list[(k-period_first_index)%period]+1)
Problem p02924 (python)

Fixed submission:
n = int(input())
print(n*(n-1)//2)

Buggy submission (verdict: Runtime Error):
n = int(input())
print(int(n(n-1)/2))
Problem p02947 (python)

Fixed submission:
n = int(input())
ss = []
for i in range(n):
    s = input()
    ss.append(''.join(sorted(s)))

ss = sorted(ss)

res = 0
while True:
    if len(ss) <= 1:
        break
    if ss[0] != ss[1]:
        ss.pop(0)
        continue
    i = 1
    while True:
        if i == len(ss):
            res += i * (i-1) / 2
            for num in range(i):
                ss.pop(0)
            break
        if ss[0] == ss[i]:
            i += 1
        else:
            res += i * (i-1) / 2
            for num in range(i):
                ss.pop(0)
            break

print(int(res))

Buggy submission (verdict: Runtime Error):
n = int(input())
ss = []
for i in range(n):
    s = input()
    ss.append(''.join(sorted(s)))

ss = sorted(ss)

res = 0
while True:
    if len(ss) == 0:
        break
    if ss[0] != ss[1]:
        ss.pop(0)
        continue
    i = 1
    while True:
        if i == len(ss):
            res += i * (i-1) / 2
            for num in range(i):
                ss.pop(0)
            break
        if ss[0] == ss[i]:
            i += 1
        else:
            res += i * (i-1) / 2
            for num in range(i):
                ss.pop(0)
            break

print(int(res))
Problem p02953 (python)

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

i = 0

while True:
    if i == n-1:
        print('Yes')
        break
    if h[i] <= h[i+1]:
        if i == 0 or h[i-1] < h[i]:
            h[i] -= 1
        i += 1
    elif h[i] == h[i+1]+1 and (i==0 or h[i-1] < h[i]):
        h[i] -= 1
        i += 1
    else:
        print('No')
        break

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

i = 0
while True:
    if i == n-1:
        print('Yes')
        break
    if h[i] <= h[i+1]:
        print(i, 'a', h)
        if i == 0 or h[i-1] < h[i]:
            h[i] -= 1
        i += 1
    elif h[i] == h[i+1]+1 and (i==0 or h[i-1] < h[i]):
        print(i, 'b', h)
        h[i] -= 1
        i += 1
    else:
        print('No')
        break
Problem p02983 (python)

Fixed submission:
l, r = map(int, input().split())

if l%2019 >= r%2019:
    print(0)
elif r-l >= 2019:
    print(0)
elif l%2019 == 0 or r%2019 == 0:
    print(0)
else:
    h = []
    for i in range((r-l)%2019):
        for j in range(i+1, (r-l+1)%2019):
            h.append((((l+i)%2019)*((l+j)%2019))%2019)
    print(min(h))

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

if l%2019 >= r%2019:
    print(0)
elif l%2019 == 0 or r%2019 == 0:
    print(0)
else:
    h = []
    for i in range(1, (r-l)%2019):
        h.append((l%2019)*((l+i)%2019)%2019)
    print(min(h))
Problem p03240 (python)

Fixed submission:
n = int(input())
x = []
y = []
h = []
ot = []
for i in range(n):
    xi, yi, hi = [int(_) for _ in input().split()]
    if hi != 0:
        x.append(xi)
        y.append(yi)
        h.append(hi)
    else:
        ot.append([xi, yi, hi])

ans = []
for cxi in range(101):
    for cyi in range(101):
        flag = True
        for i in range(len(h)):
            if i == 0:
                height = h[i] + abs(x[i]-cxi) + abs(y[i]-cyi)
            else:
                if height != h[i] + abs(x[i]-cxi) + abs(y[i]-cyi):
                    flag = False
                    continue
        if flag:
            ans.append([cxi, cyi, height])

if len(ans) == 1:
    print(ans[0][0], ans[0][1], ans[0][2])
else:
    for a in ans:
        flag = True
        for o in ot:
            if max((a[2] - abs(o[0]-a[0]) - abs(o[1]-a[1])), 0) != o[2]:
                flag = False
                continue
        if flag:
            print(a[0], a[1], a[2])

Buggy submission (verdict: Runtime Error):
n = int(input())
x = []
y = []
h = []
for i in range(n):
    xi, yi, hi = [int(_) for _ in input().split()]
    if hi != 0:
        x.append(xi)
        y.append(yi)
        h.append(hi)

for cxi in range(101):
    for cyi in range(101):
        flag = True
        for i in range(n):
            if i == 0:
                height = h[i] + abs(x[i]-cxi) + abs(y[i]-cyi)
            else:
                if height != h[i] + abs(x[i]-cxi) + abs(y[i]-cyi):
                    flag = False
                    continue
        if flag:
            print(cxi, cyi, height)
Problem p03262 (python)

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


n, x = [int(_) for _ in input().split()]
x_list = [int(_) - x for _ in input().split()]

x_sorted = sorted(x_list)

x_gaps = [x_sorted[i+1] - x_sorted[i] for i in range(0, n-1)]

if len(x_gaps) == 0:
    print(abs(x_sorted[0]))
elif len(x_gaps) == 1:
    print(gcd(abs(x_list[0]), abs(x_list[1])))
else:
    result = x_sorted[0]
    for i in range(0, n-2):
        if i == 0:
            result = gcd(x_gaps[0], x_gaps[1])
        else:
            result = gcd(result, x_gaps[i+1])
    print(result)

Buggy submission (verdict: Runtime Error):
import fraction

n, x = [int(_) for _ in input().split()]
x_list = [int(_) - x for _ in input().split()]
print(x_list)

x_sorted = sorted(x_list)

x_gaps = [x_sorted[i+1] - x_sorted[i] for i in range(0, n-1)]

result = x_sorted[0]
for i in range(0, n-2):
    if i == 0:
        result = fraction.gcd(x_gaps[0], x_gaps[1])
    else:
        result = fraction.gcd(result, x_gaps[i+1])

print(result)
Problem p03282 (python)

Fixed submission:
s = list(input())
k = int(input())

for i, si in enumerate(s):
    if si != '1':
        ind = i
        res = si
        break
    if i == len(s) - 1:
        res = 'one'

if res == 'one':
    print(1)
elif ind >= k:
    print(1)
else:
    print(res)

Buggy submission (verdict: Runtime Error):
s = list(input())
k = int(input())

for i, si in enumerate(s):
    if si != '1':
        ind = i
        res = si
        break
    if i == len(s):
        res = 'one'

if res == 'one':
    print(1)
elif ind >= k:
    print(1)
else:
    print(res)
Problem p03353 (python)

Fixed submission:
s = input()
k = int(input())

s_list = []
for i in range(0, len(s)):
    for j in range(1, 1+k):
        if len(s_list) < k:
            s_list.append(s[i:i+j])
            s_list = list(set(s_list))
            s_list.sort()
        elif s_list[k-1] > s[i:i+j]:
            s_list.append(s[i:i+j])
            s_list = list(set(s_list))
            s_list.sort()
            s_list = s_list[:k]
    else:
        continue

dict_list = list(set(s_list))
dict_list.sort()

print(dict_list[k-1])

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())

s_list = []
for i in range(0, len(s)):
    for j in range(1, 1+k):
        if len(s_list) < k:
            s_list.append(s[i:i+j])
            s_list.sort()
        elif s_list[k-1] > s[i:i+j]:
            s_list.append(s[i:i+j])
            s_list = list(set(s_list))
            s_list.sort()
            s_list = s_list[:k]
    else:
        continue

dict_list = list(set(s_list))
dict_list.sort()

print(dict_list[k-1])
Problem p03380 (python)

Fixed submission:
n = int(input())
a = sorted(list(map(int, input().split())), reverse=True)
a1 = a.pop(0)

if a[0] <= a1 / 2:
    res = a[0]
elif a[-1] >= a1 / 2:
    res = a[-1]
else:
    left = 0
    right = n-2
    while True:
        j = (left + right) // 2
        if left == right:
            res = a[left]
            break
        elif a1/2 >= a[j+1] and a1/2 <= a[j]:
            if abs(a[j+1]-a1/2) >= abs(a[j]-a1/2):
                res = a[j]
            else:
                res = a[j+1]
            break
        elif a1/2 > a[j]:
            right = j
        else:
            left = j

print(a1, res)

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

res = 0
big = 0
small = 0

for i in range(n-1):
    if a[i:][0] <= a[i] / 2:
        t = a[i:][0]
        comb = 1
        for k in range(t, a[i]+1):
            comb *= k
        for k in range(1, a[i]-t+2):
            comb /= k
        if comb >= res:
            res = comb
            big = a[i]
            small = t
    elif a[-1] >= a[i] / 2:
        t = a[-1]
        comb = 1
        for k in range(t, a[i]+1):
            comb *= k
        for k in range(1, a[i]-t+2):
            comb /= k
        if comb >= res:
            res = comb
            big = a[i]
            small = t
    else:
        left = i+1
        right = n-1
        while True:
            j = (left + right) // 2
            if n == 2:
                t = a[1]
                break
            elif left == right:
                t = a[left]
                break
            elif a[i]/2 >= a[j+1] and a[i]/2 <= a[j]:
                if abs(a[j+1]-a[i]/2) >= abs(a[j]-a[i]/2):
                    t = a[j]
                else:
                    t = a[j+1]
                break
            elif a[i]/2 > a[j]:
                right = j
            else:
                left = j

        comb = 1
        for k in range(t, a[i]+1):
            comb *= k
        for k in range(1, a[i]-t+2):
            comb /= k
        if comb >= res:
            res = comb
            big = a[i]
            small = t

print(big, small)
Problem p03472 (python)

Fixed submission:
n, h = map(int, input().split())
a = []
b = []
for i in range(n):
    ai, bi = map(int, input().split())
    a.append(ai)
    b.append(bi)
b.append(0)
a2 = sorted(a, reverse=True)
b2 = sorted(b, reverse=True)

count = 0
while True:
    if h <= 0:
        break
    elif b2[0] <= a2[0]:
        count += -(- h // a2[0])
        break
    else:
        h -= b2.pop(0)
        count += 1

print(count)

Buggy submission (verdict: Runtime Error):
n, h = map(int, input().split())
a = []
b = []
for i in range(n):
    ai, bi = map(int, input().split())
    a.append(ai)
    b.append(bi)
a = sorted(a, reverse=True)
b = sorted(b, reverse=True)

count = 0
while True:
    if h <= 0:
        break
    elif b[0] <= a[0]:
        count += -(- h // a[0])
        break
    else:
        h -= b.pop(0)
        count += 1

print(count)
Problem p03557 (python)

Fixed submission:
n = int(input())
a = sorted(list(map(int, input().split())))
b = sorted(list(map(int, input().split())))
c = sorted(list(map(int, input().split())))

bc = []
idx = 0
for i in range(n):
    while True:
        if b[i] >= c[-1]:
            bc.append(0)
            break
        elif c[idx] <= b[i]:
            idx += 1
        else:
            bc.append(n-idx)
            break

bc2 = bc[::-1]
ab2 = []
absum = 0
for i in range(n):
    absum += bc2[i]
    ab2.append(absum)
ab = ab2[::-1]

res = 0
idx = 0
for i in range(n):
    while True:
        if a[i] >= b[-1]:
            break
        elif b[idx] <= a[i]:
            idx += 1
        else:
            res += ab[idx]
            break
print(res)

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

bc = []
idx = 0
for i in range(n):
    while True:
        if b[i] >= c[-1]:
            break
        elif c[idx] <= b[i]:
            idx += 1
        else:
            bc.append(n-idx)
            break

bc2 = bc[::-1]
ab2 = []
absum = 0
for i in range(n):
    absum += bc2[i]
    ab2.append(absum)
ab = ab2[::-1]

res = 0
idx = 0
for i in range(n):
    while True:
        if a[i] >= b[-1]:
            break
        elif b[idx] <= a[i]:
            idx += 1
        else:
            res += ab[idx]
            break
print(res)
Problem p03633 (python)

Fixed submission:
def gcd(n, m):
    if min(n, m) == 0:
        return max(n,m)
    else:
        return gcd(min(n,m), max(n,m) % min(n,m))

def lcm(n, m):
    return n * m // gcd(n, m)


n = int(input())
t = []
for i in range(0, n):
    t.append(int(input()))
t_sorted = sorted(t)

time = 0
for i in range(0, n):
    if i == 0:
        time = t_sorted[0]
    else:
        time = lcm(time, t_sorted[i])

print(int(time))

Buggy submission (verdict: Runtime Error):
def gcd(n, m):
    if min(n, m) == 0:
        return max(n,m)
    else:
        return gcd(min(n,m), max(n,m) % min(n,m))

def lcm(n, m):
    return int(n * m / gcd(n, m))


n = int(input())
t = []
for i in range(0, n):
    t.append(int(input()))
t_sorted = sorted(t)

time = 0
for i in range(0, n):
    if i == 0:
        time = t_sorted[0]
    else:
        time = lcm(int(time), t_sorted[i])

print(int(time))

Buggy submission (verdict: Runtime Error):
import fractions

def lcm(n, m):
    return int(n * m / fractions.gcd(n, m))


n = int(input())
t = []
for i in range(0, n):
    t.append(int(input()))
t_sorted = sorted(t)

time = 0
for i in range(0, n):
    if i == 0:
        time = t_sorted[0]
    else:
        time = lcm(int(time), t_sorted[i])

print(int(time))

Buggy submission (verdict: Runtime Error):
import math

def lcm(n, m):
    return int(n * m / math.gcd(n, m))


n = int(input())
t = []
for i in range(0, n):
    t.append(int(input()))
t_sorted = sorted(t)

time = 0
for i in range(0, n):
    if i == 0:
        time = t_sorted[0]
    else:
        time = lcm(int(time), t_sorted[i])

print(int(time))

Buggy submission (verdict: Runtime Error):
def gcd(n, m):
    if max(n,m) % min(n,m) == 0:
        return min(n,m)
    else:
        return gcd(max(n,m), max(n,m) - min(n,m) * (max(n,m)//min(n,m)))

def lcm(n, m):
    return n * m / gcd(n, m)


n = int(input())
t = []
for i in range(0, n):
    t.append(int(input()))

time = 0
for i in range(0, n-1):
    if i == 0:
        time = t[0]
    time = lcm(time, t[i+1])

print(int(time))
Problem p03280 (python)

Fixed submission:
data = input().split()
a = int(data[0])
b = int(data[1])
print(a * b - a - b + 1)

Buggy submission (verdict: Runtime Error):
data = input()
a = int(data[0])
b = int(data[1])
print(a * b - a - b + 1)
Problem p02713 (python)

Fixed submission:
from math import gcd 
K=int(input())
res=0
for i in range(1,K+1):
     for j in range(1,K+1):
            for k in range(1,K+1):
                res += gcd(gcd(i,j),k)
print(res)

Buggy submission (verdict: Runtime Error):
from gcd import math
K=int(input())
res=0
for i in range(1,K+1):
     for j in range(1,K+1):
            for k in range(1,K+1):
                res=res+gcd(gcd(i,j),k)
print(res)

Buggy submission (verdict: Runtime Error):
from gcd import math
K=int(input())
res=0
for i in range(1,K):
     for j in range(1,K):
            for k in range(1,K):
                res=res+gcd(gcd(i,j),k)
print(res)
Problem p02731 (python)

Fixed submission:
L=int(input())
import math
l=L/3
print(l**3)

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

if L==1:
    res1=0
    x = np.arange(0.1, 10.1, 0.1)
    for i in x:
        for j in x:
            res1=max(res1,i*j*(L-i-j))
else:
    res=0
    for i in range(1,1001):
        for j in range(1,1001):
            res=max(res,i*j*(L-i-j))
print(res if res!=0 else res1)
Problem p02760 (python)

Fixed submission:
import numpy as np
A=list(list(map(int, input().split())) for _ in range(3))
N=int(input())
B=list(int(input()) for _ in range(N))
a=np.array(A)
c=a.flatten()
C=c.tolist()

for c in range(len(C)):
    for b in range(len(B)):
        if C[c]==B[b]:
            C[c]=0

if (sum(C[:3])==0) | (sum(C[3:6])==0) | (sum(C[6:9])==0):
    print("Yes")
elif (C[0]+C[3]+C[6]==0) | (C[1]+C[4]+C[7]==0) | (C[2]+C[5]+C[8]==0):
    print("Yes")
elif (C[0]+C[4]+C[8]==0) | (C[2]+C[4]+C[6]==0): 
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import numpy as np
A=list(list(map(int, input().split())) for _ in range(3))
N=int(input())
B=list(int(input()) for _ in range(N))
a=np.array(A)
c=a.flatten()
C=c.tolist()

for c in range(len(C)):
    for b in range(len(B)):
        if C[c]==B[b]:
            C[c]=0

            if (sum(C[:3])==0) | (sum(C[3:6])==0) | (sum(C[6:9])==0):
    print("Yes")
elif (C[0]+C[3]+C[6]==0) | (C[1]+C[4]+C[7]==0) | (C[2]+C[5]+C[8]==0):
    print("Yes")
elif (C[0]+C[4]+C[8]==0) | (C[2]+C[4]+C[6]==0): 
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import numpy as np
A=list(list(map(int, input().split())) for _ in range(3))
N=int(input())
B=list(int(input()) for _ in range(N))
a=np.array(A)
C=a.flatten()

for c in range(len(C)):
    for b in range(len(B)):
        if C[c]==B[b]:
            C[c]=0

            if (sum(C[:3])==0) | (sum(C[3:6])==0) | (sum(C[6:9])==0):
    print("Yes")
elif (C[0]+C[3]+C[6]==0) | (C[1]+C[4]+C[7]==0) | (C[2]+C[5]+C[8]==0):
    print("Yes")
elif (C[0]+C[4]+C[8]==0) | (C[2]+C[4]+C[6]==0): 
    print("Yes")
else:
    print("No")
Problem p02780 (python)

Fixed submission:
N,K=map(int, input().split())
S=list(map(int, input().split()))
s=sum(S[:K])
dp=[0]*(N-K+1)
dp[0]=s
for i in range(1,N-K+1):
    s=s-S[i-1]+S[i+K-1]
    if s>dp[i-1]:
        dp[i]=s
print((max(dp)+K)/2)

Buggy submission (verdict: Runtime Error):
s=sum(S[:K])
dp=[0]*(N-K+1)
dp[0]=s
for i in range(1,N-K+1):
    s=s-S[i-1]+S[i+K-1]
    if s>dp[i-1]:
        dp[i]=s
print((max(dp)+K)/2)
Problem p02802 (python)

Fixed submission:
N,M=map(int, input().split())
wa=[0]*N # カウント
ac=[0]*N # 何回目でacか
ac_n=0
for _ in range(M):
    p,s=input().split()
    p=int(p)
    if s=='WA':
        wa[p-1]+=1
    if (s=='AC') and (ac[p-1]==0):
        ac[p-1]=wa[p-1]+1
        ac_n+=1
print(str(ac_n)+' '+str(sum(ac)-ac_n))

Buggy submission (verdict: Runtime Error):
N,M=map(int, input().split())
q=list([] for m in range(M))
if 1<=M:
    x0,y0=input().split()
    q[0].append(y0)
    for m in range(M-1):
        x,y=input().split()
        q[int(x)-int(x0)].append(y)
wa=[0]*M
ac=[0]*M
for i in range(len(q)):
    for j in range(len(q[i])):
        if (q[i][j]=='AC')&(ac[i]==0):
            ac[i]=1
            wa[i]=j
print(sum(ac),sum(wa))
Problem p02706 (python)

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

if M < sum(l):
  print(-1)
else:
  print(M - sum(l))

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

if M < A + B:
  print(-1)
else:
  print(M - A - B)
Problem p02706 (python)

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

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

if(N >= sum(a)):
    print(N - sum(a))
else:
    print(-1)

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

a = [int(input()) for i in range(M)]

if(N >= sum(a)):
    print(N - sum(a))
else:
    print(-1)

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

sum = 0

for i in range(1,M+1):
    sum += int(input())

if(N >= sum):
    print(N - sum)
else:
    print(-1)
Problem p03059 (python)

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

print(T//A*B)

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

print(T//A*B)
Problem p03623 (python)

Fixed submission:
x,a,b = map(int,input().split())

if abs(x-b) < abs(x-a):
    print('B')
elif abs(x-a) < abs(x-b):
    print('A')

Buggy submission (verdict: Runtime Error):
a,b,c=input();print('YNeos'[a!=c::2])
Problem p03773 (python)

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

print((A+B)%24)

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

print((A+B)%24)
Problem p03826 (python)

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

print(max(A*B,C*D))

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

print(max(A*B,C*D))