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

Fixed submission:
from itertools import combinations

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

def f(a, b, c):
    return len(set([a, b, c])) == 3 and a+b>c and b+c>a and c+a>b

ans = 0
for a, b, c in combinations(L, 3):
    if f(a, b, c):
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter
from itertools import combinations

N = int(input())
L = Counter(list(map(int, input().split())))
ans = 0
for sides in combinations(L.keys(), 3):
    a, b, c = sides.sorted()
    if a + b > c:
        ans += L[a]*L[b]*L[c]
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter
from itertools import combinations

N = int(input())
L = Counter(list(map(int, input().split())))
ans = 0
for sides in combinations(L.keys(), 3):
    a, b, c = sides.sorter()
    if a + b > c:
        ans += L[a]*L[b]*L[c]
print(ans)
Problem p02616 (python)

Fixed submission:
mod = 1000000007
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
A.sort()
ans = 1
# 選択の余地がない時
if len(A) == K:
    for i in range(K):
        ans = ans * (A[i]%mod) % mod
# 負になってしまう時
elif A[-1] < 0 and K%2 == 1:
    for i in range(K):
        ans = ans * (A[-i-1]%mod) % mod
else:
    n = 0
    p = -1
    # Kが奇数の時、正の候補の最大値をあらかじめ消費しておき、偶数の時と同様に処理できるようにする。
    if K%2 == 1:
        ans = ans * (A[p]%mod) % mod
        p -= 1
    # 正/負の候補から２つずつ消費していく
    for _ in range(K//2):
        if A[n]*A[n+1] > A[p]*A[p-1]:
            ans = ans * (A[n]%mod) % mod
            ans = ans * (A[n+1]%mod) % mod
            n += 2
        else:
            ans = ans * (A[p]%mod) % mod
            ans = ans * (A[p-1]%mod) % mod
            p -= 2        

print(ans)

Buggy submission (verdict: Runtime Error):
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
pos = []
neg = []
for a in A:
    if a >= 0:
        pos.append(a)
    else:
        neg.append(-1*a)

pos.sort(reverse=True)
neg.sort(reverse=True)
p_l = len(pos)
n_l = len(neg)
sign = 1
i, j = 0, 0
for _ in range(K):
    if pos[i] > neg[j] and i < p_l - 1:
        i += 1
    elif pos[i] <= neg[j] and j < n_l - 1:
        j += 1
        sign *= -1
    elif i < p_l - 1:
        j += 1
        sign *= -1
    elif j < n_l - 1:
        i += 1
if sign == -1:
    a, b = -1, -1
    if i < p_l - 1:
        a = pos[i+1]/neg[j]
    if j < n_l - 1:
        b = neg[j+1]/pos[i]
    if a > b:
        i += 1
        j -= 1
    else:
        i -= 1
        j += 1

ans = 1
for p in pos[:i]:
    ans *= p
for n in neg[:j]:
    ans *= n

print(ans)
Problem p02642 (python)

Fixed submission:
from collections import Counter
 
N = int(input())
A_raw = Counter(list(map(int, input().split())))
A = [x[0] for x in A_raw.items() if x[1] == 1]
A.sort()
B = [x[0] for x in A_raw.items() if x[1] > 1]
B.sort()
seen = [0]*(1000000+1)
for b in B:
    if seen[b] == 0:
        x = b
        j = 1
        while x <= 1000000:
            seen[x] = 1
            j += 1
            x = b*j
ans = 0
for a in A:
    if seen[a] == 0:
        ans += 1
        x = a
        j = 1
        while x <= 1000000:
            seen[x] = 1
            j += 1
            x = a*j
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
seen = [0]*(200000+1)
A.sort()
ans = 0
for a in A:
    if seen[a] == 0:
        ans += 1
        x = a
        j = 1
        while x <= 200000:
            seen[x] = 1
            j += 1
            x = a*j
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
seen = [0]*(200+1)
A.sort()
ans = 0
for a in A:
    if seen[a] == 0:
        ans += 1
        x = a
        j = 1
        while x <= 200:
            seen[x] = 1
            j += 1
            x = a*j
print(ans)
Problem p02663 (python)

Fixed submission:
H1, M1, H2, M2, K = list(map(int, input().split()))
print(H2*60 + M2 - K - H1*60 - M1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
if N == 0 and A[0] == 1:
    print(1)
else:
    nodes = [0]*(N+1)
    s_d = 0 # 飽和してないノードが残ってる深さ
    cap_d = 1 - A[0]
    failed = False
    for i, a in enumerate(A):
        # a個の葉をなるべく浅いノードから取る
        while a > 0:
            # これ以上分岐することろがなければ失敗
            if i < s_d or cap_d <= 0:
                failed = True
                break
            # s_dから枝を取れるだけ取る
            x = min(cap_d - nodes[s_d], a)
            a -= x
            nodes[s_d:i+1] = [node + x for node in nodes[s_d:i+1]]
            # s_dがいっぱいになったら深さを一つ進める
            if nodes[s_d] >= cap_d:
                cap_d -= A[s_d]
                cap_d *= 2
                s_d += 1
        if failed:
            break
    print(-1 if failed else sum(nodes))
Problem p02681 (python)

Fixed submission:
S = input()
T = input()
print('Yes' if T[:-1] == S else 'No')

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

N, M, X = list(map(int, input().split()))
conditions = product([0, 1], repeat=N)
A = np.array([list(map(int, input().split())) for i in range(N)])
succeed = []
for c in conditions:
    p = A * np.array(c).reshape((N, 1))
    res = p.sum(axis=0)
    if np.all(res[1:] >= X):
        succeed.append(res[0])
print(min(succeed) if len(succeed) > 0 else -1)
Problem p02683 (python)

Fixed submission:
N, M, X = list(map(int, input().split()))
conditions = [str(bin((2**N + i) & (2**(N+1) - 1)))[3:] for i in range(2**N)]
Q = [list(map(int, input().split())) for i in range(N)]
ans = -1
for c in conditions:
    res = [0]*(M+1)
    for i in range(N):
        if c[i] == '1':
            for j in range(M+1):
                res[j] += Q[i][j]

    failed = False
    for i in range(1, M+1):
        if res[i] >= X:
            continue
        else:
            failed = True
    if failed:
        continue
    else:
        if ans == -1:
            ans = res[0]
        else:
            ans = min(ans, res[0])

print(ans)

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

N, M, X = list(map(int, input().split()))
conditions = product([0, 1], repeat=N)
A = np.array([list(map(int, input().split())) for i in range(N)])
succeed = []
for c in conditions:
    p = A * np.array(c).reshape((N, 1))
    res = p.sum(axis=0)
    if np.all(res[1:] >= X):
        succeed.append(res[0])
print(min(succeed) if len(succeed) > 0 else -1)
Problem p02684 (python)

Fixed submission:
N, K = list(map(int, input().split()))
K -= 1
A = list(map(lambda x: int(x) - 1, input().split()))
seen = [None]*N
seen_set = set()
now = 0
for i in range(N):
    seen[i] = now
    seen_set.add(now)
    to = A[now]
    now = to
    if now in seen_set:
        seen[i+1] = now
        loop_s = seen.index(now)
        loop_end = i + 1
        size = loop_end - loop_s
        break
if K <= loop_s:
    print(seen[K+1] + 1)
else:
    K -= loop_s
    print(seen[loop_s + 1 + K % size] + 1)

Buggy submission (verdict: Runtime Error):
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
loop_size = 0
loop = [None]*N
now = 0
for i in range(N):
    loop_size += 1
    to = A[now] - 1
    now = to
    loop[i] = to
    if to == 0:
        break
print(loop[K%loop_size - 1]+1)
Problem p02780 (python)

Fixed submission:
from itertools import accumulate

N, K = list(map(int, input().split()))
P = list(map(lambda x: int(x) + 1, input().split()))
P_cumsum = [0] + list(accumulate(P))
print(max([P_cumsum[i+K]-P_cumsum[i] for i in range(N-K+1)])/2)

Buggy submission (verdict: Runtime Error):
from itertools import accumulate

N, K = list(map(int, input().split()))
P = list(map(lambda x: int(x) + 1, input().split()))
P_cumsum = list(accumulate(P))
print(max([P_cumsum[i+K]-P_cumsum[i] for i in range(N-K)])/2)
Problem p02804 (python)

Fixed submission:
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 10**5
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

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

ans = 0
for i in range(N-K+1):
    ans += A[-1-i]*cmb(N-1-i, K-1, mod)
    ans %= mod
    ans -= A[i]*cmb(N-1-i, K-1, mod)
    ans %= mod

print(ans)

Buggy submission (verdict: Runtime Error):
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 10**4
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

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

ans = 0
for i in range(N-K+1):
    ans += A[-1-i]*cmb(N-1-i, K-1, mod)
    ans %= mod
    ans -= A[i]*cmb(N-1-i, K-1, mod)
    ans %= mod

print(ans)

Buggy submission (verdict: Runtime Error):
nCr = {}
def cmb(n, r):
    if r == 0 or r == n:
        return 1
    if r == 1:
        return n
    if (n,r) in nCr:
        return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

INF = 10**9+7
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
A.sort()

ans = 0
for i in range(N-K+1):
    ans += A[-1-i]*cmb(N-1-i, K-1)
    ans %= INF
    ans -= A[i]*cmb(N-1-i, K-1)
    ans %= INF

print(ans)
Problem p02882 (python)

Fixed submission:
import math

a, b, x = list(map(int, input().split()))
if a**2*b == x:
    theta = 90
elif a**2*b/2 > x:
    h = 2*x/a/b
    theta = math.degrees(math.atan(h/b))
else:
    h = 2*x/(a**2)-b
    theta = math.degrees(math.atan(a/(b-h)))

print(90 - theta)

Buggy submission (verdict: Runtime Error):
import math

a, b, x = list(map(int, input().split()))
if a**2*b/2 < x:
    h = 2*x/(a**2)-b
    theta = math.atan(a/(b-h))
else:
    h = 2*x/a/b
    theta = math.atan(h/b)

print(90 - math.degrees(theta))

Buggy submission (verdict: Runtime Error):
import math

a, b, x = list(map(int, input().split()))
if a**2*b/2 < x:
    h = 2*x/(a**2)-b
    theta = math.atan(a/(b-h))
else:
    h = 2*x/a/b
    theta = math.atan(h/b)

print(90 - math.degrees(theta))
Problem p02921 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
print(N*(N-1)//2)
Problem p02995 (python)

Fixed submission:
def gcd(a, b):
    if a < b:
        tmp = a
        a = b
        b = tmp

    r = a % b
    while r!=0:
        a = b
        b = r
        r = a % b
    return b

def lcm(a, b):
    return int(a * b / gcd(a, b))

A, B, C, D = list(map(int, input().split()))
A_ = A - 1
lcm_CD = lcm(C, D)
B_res = B - (B//C + B//D - B//lcm_CD)
A_res = A_ - (A_//C + A_//D - A_//lcm_CD)
print(B_res - A_res)

Buggy submission (verdict: Runtime Error):
import math
A, B, C, D = list(map(int, input().split()))
A_ = A - 1
B_res = B - (B//C + B//D - B//int(C*D/math.gcd(C, D)))
A_res = A_ - (A_//C + A_//D - A_//int(C*D/math.gcd(C, D)))
print(B_res - A_res)
Problem p03165 (python)

Fixed submission:
s = input()
t = input()
dp = [[0]*(len(t)+1) for _ in range(len(s)+1)]
for i in range(len(s)):
    for j in range(len(t)):
        if s[i] == t[j]:
            dp[i+1][j+1] = max(dp[i+1][j+1], dp[i][j] + 1)
        else:
            dp[i+1][j+1] = max(dp[i+1][j+1], dp[i][j])
        dp[i+1][j+1] = max(dp[i+1][j+1], dp[i+1][j], dp[i][j+1])

ans = ''
i, j = len(s), len(t)
while 0 < i and 0 < j:
    if dp[i][j] == dp[i-1][j]:
        i -= 1
    elif dp[i][j] == dp[i][j-1]:
        j -= 1
    else:
        i -= 1
        j -= 1
        ans += s[i]
print(ans[::-1])

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
dp = [[0]*(len(t)+1) for _ in range(len(s)+1)]
for i in range(len(s)):
    for j in range(len(t)):
        if s[i] == t[j]:
            dp[i+1][j+1] = max(dp[i+1][j+1], dp[i][j] + 1)
        else:
            dp[i+1][j+1] = max(dp[i+1][j+1], dp[i][j])
        dp[i+1][j+1] = max(dp[i+1][j+1], dp[i+1][j], dp[i][j+1])

ans = ''
i, j = 0, 0
while i <= len(s) and j <= len(s):
    if dp[-1-i][-1-j] == dp[-1-i-1][-1-j]:
        i += 1
    elif dp[-1-i][-1-j] == dp[-1-i][-1-j-1]:
        j += 1
    else:
        ans += s[-1-i]
        i += 1
        j += 1
print(ans[::-1])
Problem p03166 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**9)

N, M = list(map(int, input().split()))
G = [[] for _ in range(N)]

for _ in range(M):
    x, y = list(map(lambda x: int(x) - 1, input().split()))
    G[x].append(y)

dp = [-1]*(N)

def f(v):
    if dp[v] != -1:
        return dp[v]
    ans = 0
    for nv in G[v]:
        ans = max(ans, f(nv) + 1)
    dp[v] = ans
    return ans

ans = 0
for i in range(N):
    ans = max(ans, f(i))

print(max(dp))

Buggy submission (verdict: Runtime Error):
N, M = list(map(int, input().split()))
G = [[] for _ in range(N)]

for _ in range(M):
    x, y = list(map(lambda x: int(x) - 1, input().split()))
    G[x].append(y)

dp = [-1]*(N)

def f(v):
    if dp[v] != -1:
        return dp[v]
    ans = 0
    for nv in G[v]:
        ans = max(ans, f(nv) + 1)
    return ans

for i in range(N):
    dp[i] = f(i)

print(max(dp))
Problem p02601 (python)

Fixed submission:
a, b, c = list(map(int, input().split()))
k = int(input())
 
ans = False
 
for i in range(k):
    if c <= b:
        c *= 2
    elif b <= a:
        b *= 2
    else:
        ans = True
        break
if c > b and b > a:
    ans = True

if ans:
  	print("Yes")
else:
  	print("No")

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

ans = False

for i in range(k):
	if c <= b:
      	c *= 2
    elif b <= a:
      	b *= 2
    else:
      	ans = True
        break

if ans:
  	print("Yes")
else:
  	print("No")
Problem p02612 (python)

Fixed submission:
N = int(input())
rest = N%1000
if rest==0:
  print(0)
else:
  print(1000-rest)

Buggy submission (verdict: Runtime Error):
N = int(input())
rest = N//1000
return 1000-rest
Problem p02613 (python)

Fixed submission:
from collections import defaultdict
d = defaultdict(int)
N = int(input())
for i in range(N):
  d[input()] += 1
print(f"AC x {d['AC']}")
print(f"WA x {d['WA']}")
print(f"TLE x {d['TLE']}")
print(f"RE x {d['RE']}")

Buggy submission (verdict: Runtime Error):
from collectinos import defaultdict
d = defaultdict(int)
N = int(input())
for i in range(N):
  d[input()] += 1
print(f"AC x {d['AC']}")
print(f"WA x {d['WA']}")
print(f"TLE x {d['TLE']}")
print(f"RE x {d['RE']}")
Problem p02675 (python)

Fixed submission:
N = int(input())
N = N%10
if N in [2,4,5,7,9]:
  print('hon')
elif N in[0,1,6,8]:
  print('pon')
elif N == 3:
  print('bon')

Buggy submission (verdict: Runtime Error):
N = int(input())
N = N%10
if N in [2,4,5,7,9]:
  return'hon'
elif N in[0,1,6,8]:
  return 'pon'
elif N == 3:
  return 'bon'
Problem p02645 (python)

Fixed submission:
S = list(input())
print(''.join(S[0:3]))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split()))
if N < K*3:
    for i in range(N):
        print(N, end=' ')
    print('')
else:
    for k in range(K):
        B = [0]*N
        for i in range(N):
            for j in range(max(i-A[i], 0), min(A[i]+i+1, N)):
                B[j] += 1
        A = B
    print(A)
Problem p02665 (python)

Fixed submission:
import sys
N = int(input())
A = list(map(int, input().split()))

l = []

if N == 0:
    if A[0] != 1:
        print(-1)
        exit()

temp = 1
for i in range(N+1):
    l.append(temp-A[i])
    temp = (temp-A[i])*2

for i in range(N+1):
    if l[i] < 0:
        print(-1)
        sys.exit()



ans = 1
node = 0
for i in range(N, 0, -1):
    if l[i-1] >= node + A[i]:
        node += A[i]
        ans += node
    else:
        ans += node + A[i]
        node = l[i-1]

print(ans)

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

l = []

if A[0] != 0:
    print(-1)
    sys.exit()

for i in range(N+1):
    if A[i] > 2*A[i+1]:
        print(-1)
        sys.exit()

temp = 1
for i in range(N+1):
    l.append(temp-A[i])
    temp = (temp-A[i])*2

for i in range(N+1):
    if l[i] < 0:
        print(-1)
        sys.exit()

ans = 1
node = 0
for i in range(N, 0, -1):
    if l[i-1] >= node + A[i]:
        node += A[i]
        ans += node
    else:
        ans += node + A[i]
        node = l[i-1]

print(ans)

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

l = []

if A[0] != 0:
    print(-1)
    sys.exit()

if N == ０:
    print(-1)
    sys.exit()

temp = 1
for i in range(N+1):
    l.append(temp-A[i])
    temp = (temp-A[i])*2

for i in range(N+1):
    if l[i] < 0:
        print(-1)
        sys.exit()

ans = 1
node = 0
for i in range(N, 0, -1):
    if l[i-1] >= node + A[i]:
        node += A[i]
        ans += node
    else:
        ans += node + A[i]
        node = l[i-1]

print(ans)
Problem p02681 (python)

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

ans = 'Yes'
for i in range(len(S)):
    if S[i] != T[i]:
        ans = 'No'

print(ans)

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

now = 1
temp_l = [0]*N
temp_count = [-1]*N
temp_count[0] = 0
for i in range(N):
    pre = now
    now = A[pre-1]
    if temp_l[now-1] == 1:
        end = now
        temp = i+1
        break
    else:
        temp_l[now-1] = 1
        temp_count[now-1] = i+1

s_index = temp_count[end-1]
repeat = temp - s_index
K -= s_index
K = K % repeat

print(temp_count.index(K+s_index)+1)

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

temp = 0
temp_l = [1]
now = 1
while True:
    temp += 1
    pre = now
    now = A[pre-1]
    if now in temp_l:
        end = now
        break
    else:
        temp_l.append(now)

s_index = temp_l.index(end)
repeat = temp - s_index
K -= s_index
K = K % repeat

print(temp_l[s_index:][K])
Problem p02741 (python)

Fixed submission:
K = int(input())
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
 
print(l[K-1])

Buggy submission (verdict: Runtime Error):
K = int(input())
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(l[k-1])
Problem p02917 (python)

Fixed submission:
N = int(input())
A = [100001] * N
B = list(map(int, input().split()))

if N == 2:
  print(B[0]*2)
else: 
  for i in range(N-1):
    A[i] = B[i]
  for i in range(N-2):
    if A[i+1] > B[i]:
      A[i+1] = B[i]

  A[-1] = B[-1]

  print(sum(A))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [-1] * N
B = list(map(int, input().split()))

N = int(input())
A = [100001] * N
B = list(map(int, input().split()))

if N == 2:
  print(B[0]*2)
else: 
  for i in range(N-2):
    if A[i] > min(B[i], B[i+1]):
      A[i] = min(B[i], B[i+1])
    if A[i+1] > min(B[i], B[i+1]):
      A[i+1] = min(B[i], B[i+1])

  A[-1] = B[-1]

  print(sum(A))
Problem p02924 (python)

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

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

NL = []
PL = []
ans = 0

if N < 10:
  for i in range(N):
    NL.append(i+1)
    PL.append(i+2)
else:
  NL = list(range(1, N+1))
  PL = list(range(2, N+2))
PL[N-1] = 1

for i in range(N):
  ans += NL[i] % PL[i]

print(ans)
Problem p03029 (python)

Fixed submission:
A, P = map(int, input().split())
 
Apple = 3*A + P
 
if Apple % 2 == 0:
  ans = Apple/2
else:
  ans = (Apple-1)/2
 
print(int(ans))

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

Apple = 3*A + P

if Apple % 2 == 0:
  ans = APPLE/2
else:
  ans = (Apple-1)/2

print(int(ans))

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

APPLE = 3*A + P

if APPLE % 2 = 0:
  ans = APPLE/2
else:
  ans = (Apple-1)/2

print(ans)

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

APPLE = 3*A + P

if APPLE % 2 = 0:
  ans = APPLE/2
else:
  ans = (Apple-1)/2
Problem p03102 (python)

Fixed submission:
N, M, C = map(int, input().split())
B = list(map(int, input().split()))
A = []
A.append([list(map(int, input().split())) for _ in range(N)])
ans = 0  
temp = 0

for i in range(N):
  for j in range(M):
    temp += B[j] * A[0][i][j]
  if temp + C > 0:
    ans += 1
  temp = 0

print(ans)

Buggy submission (verdict: Runtime Error):
N, M, C = map(int, input().split())
B = list(map(int, input().split()))
A = []
A.append(list([int(input()) for _ in range(N)]))

print(A)
Problem p03238 (python)

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

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

if N == 1:
  print('Hello World')
else:
  print(int(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 p03293 (python)

Fixed submission:
A = list(input())
T = str(input())

check = 'No'

for i in range(len(A)):
  if ''.join(A) == T:
    check = 'Yes'
  A.insert(0, A.pop(-1))

print(check)

Buggy submission (verdict: Runtime Error):
A = list(input())
T = str(input())

check = 'No'


for i in range(len(A)):
  if ''.join(A) == T:
    check = 'Yes'
  A.insert(A.pop(-1))

print(check)

Buggy submission (verdict: Runtime Error):
A = sorted(list(input()))
T = sorted(list(input()))

ans = 'Yes'

for i in range(len(A)):
  if A[i] != T[i]:
    ans = "No'
    
print(ans)
Problem p03337 (python)

Fixed submission:
A, B = map(int, input().split())
 
print(max(A+B, A-B, A*B))

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

print(max(A+B, A-B, A*B))
Problem p03369 (python)

Fixed submission:
S = list(input())

ans = 700
 
for i in range(3):
  if S[i] == 'o':
    ans += 100

print(ans)

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

ans = 700

for i in range(S):
  if S[i] == 'o':
    ans += 100

print(ans)
Problem p03386 (python)

Fixed submission:
A, B, K = map(int, input().split())
l = []

if B - A + 1 > 2 * K:
  for i in range(K):
    l.append(A + i)
    l.append(B - i)
else:
  l = list(range(A, B+1))
  
l.sort()

for i in l:
  print(i)

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
l = list(range(A, B+1))

for i in range(len(l)):
  if l[i] <= A + K - 1 or B - K + 1 <= l[i]:
    print(l[i])
Problem p03455 (python)

Fixed submission:
a, b = map(int, input().split())
 
if (a * b) % 2 == 0:
  print('Even')
else:
  print('Odd')

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

if (a * b) % 2 == 0:
  print('Even')
else:
  print('Odd')
Problem p03478 (python)

Fixed submission:
N, A, B = map(int, input().split())
l = []
 
for i in range(N):
  value = 0
  for j in range(len(list(str(i+1)))):
    value += int(list(str(i+1))[j])
  if A <= value and value <= B:
    l.append(i+1)
    
print(sum(l))

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

for i in range(N):
  value = 0
  for j in range(len(list(str(i+1)))):
    value += int(list(str(i+1)))[j]
  if A <= value and value <= B:
    l.append(value)
    
print(sum(l))
Problem p03547 (python)

Fixed submission:
X, Y = map(str, input().split())
l = ['A', 'B', 'C', 'D', 'E', 'F']
 
if l.index(X) == l.index(Y):
  print('=')
elif l.index(X) < l.index(Y):
  print('<')
else:
  print('>')

Buggy submission (verdict: Runtime Error):
X, Y = map(str, input().split())
l = [A, B, C, D, E, F]

if l.index(X) == l.index(y):
  print('=')
elif l.index(X) < l.index(y):
  print('<')
else:
  print('>')