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

Fixed submission:
n = int(input())
if n == 2:
    a = int(input())
    b = int(input())

if n == 1:
    print("Hello World")
if n == 2:
    print(a + b)

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

if n == 1:
    print("Hello World")
if n == 2:
    print(ab[0] + ab[1])

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

if n == 1:
    print("Hello World")
if n == 2:
    print(ab[0] + ab[1])
Problem p02683 (python)

Fixed submission:
n,m,x = map(int,input().split())
c_ = [list(map(int,input().split())) for i in range(n)]

# print(c_)
cc_ = []
for i in range(n):
    cc_.append(c_[i][0])
# print(cc_)

import numpy as np
import itertools
l_ = np.arange(n).tolist()

res_ = []
resList = []
flag = False
flag3 = True
if n == 1:
    for i in range(m):
        if c_[0][i+1] < x:
            # print(c_[0][i+1])
            flag3 = False
    print(cc_[0] if flag3 else -1)
else:
    for i in range(1,n+1):
        c = list(itertools.combinations(l_, i))
        for j in c:
            res_ = []
            flag2 = True
            for l in range(m):
                res = 0
                sum_money = 0
                for k in range(len(j)):
                    res += c_[j[k]][l+1]
                    sum_money += c_[j[k]][0]
                # print(res,sum_money)
                if res < x:
                    flag2 = False
            if flag2:
                resList.append(sum_money)
                flag = True
    # print(resList)
    print(min(resList) if flag else -1)

Buggy submission (verdict: Runtime Error):
n,m,x = map(int,input().split())
c_ = [list(map(int,input().split())) for i in range(n)]

cc_ = []
for i in range(n):
    cc_.append(c_[i][0])
# print(cc_)

import numpy as np
import itertools
l_ = np.arange(n).tolist()

res_ = []
resList = []
flag = False
for i in range(2,n+1):
    c = list(itertools.combinations(l_, i))
    for j in c:
        # print(j)
        res_ = []
        flag2 = True
        for l in range(3):
            res = 0
            sum_money = 0
            for k in range(len(j)):
                res += c_[j[k]][l+1]
                sum_money += c_[j[k]][0]
            # print(res,sum_money)
            if res < x:
                flag2 = False
        if flag2:
            resList.append(sum_money)
            flag = True
# print(resList)
print(min(resList) if flag else -1)

Buggy submission (verdict: Runtime Error):
n,m,x = map(int,input().split())
c_ = [list(map(int,input().split())) for i in range(n)]

cc_ = []
for i in range(n):
    cc_.append(c_[i][0])
# print(cc_)

import numpy as np
import itertools
l = np.arange(n)

res1_ = []
res2_ = []
res3_ = []
cc_r_ = []
resList = []
flag = False
for i in range(2,n+1):
    c = list(itertools.combinations(l, i))
    for j in c:
        # print(j)
        res1_ = []
        res2_ = []
        res3_ = []
        cc_r_ = []
        for k in range(len(j)):
            res1_.append(c_[j[k]][1])
            res2_.append(c_[j[k]][2])
            res3_.append(c_[j[k]][3])
            cc_r_.append(cc_[j[k]])
        res1 = sum(res1_)
        res2 = sum(res2_)
        res3 = sum(res1_)
        cc_r = sum(cc_r_)
        if res1 >= x and res2 >= x and res3 >= x:
            resList.append(cc_r)
            flag = True

print(min(resList) if flag else -1)
Problem p02706 (python)

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

sum = sum(a_)
res = n - sum

if(res < 0):
    print(-1)
else:
    print(res)

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

sum = sum(s_)
res = n - sum

if(res < 0):
    print(-1)
else:
    print(res)
Problem p02717 (python)

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

print(z,x,y)

Buggy submission (verdict: Runtime Error):
x,y,z=list(map(int,input(),split()))

print(z,x,y)

Buggy submission (verdict: Runtime Error):
x,y,z=list(map(int,input(),splut()))

print(z,x,y)
Problem p02765 (python)

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

if n < 10:
    print(100 * (10 - n) + r)
else:
    print(r)

Buggy submission (verdict: Runtime Error):
n,r = map(int,input())

print(100 * (10 - n) + r)
Problem p02767 (python)

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

if n ==1:
    print(0)
else:
    cnt = 0
    res_ = []
    for i in range(100):
        cnt = 0
        for j in range(len(x_)):
            cnt += (x_[j] - i)**2
        res_.append(cnt)

    print(min(res_))

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

if n ==1:
    print(0)
else:
    cnt = 0
    res_ = []
    for i in range(x_[0],x_[n-1]):
        cnt = 0
        for j in range(len(x_)):
            cnt += (x_[j] - i)**2
        res_.append(cnt)

    print(min(res_))

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

cnt = 0
res_ = []
for i in range(1,x_[n-1]):
    cnt = 0
    for j in range(len(x_)):
        cnt += (x_[j] - i)**2
    res_.append(cnt)
print(min(res_))
Problem p02780 (python)

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

def calc_ex(x):
    return  x/2 + 0.5
p_ = list(map(calc_ex,p_))

res = sum(p_[:k])
cnt = sum(p_[:k])
for i in range(1,n-k+1):
    cnt = cnt - p_[i-1] + p_[i+k-1]
    res = max(res,cnt)
print(res)

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

def calc_ex(x):
    return  x/2 + 0.5
p_ = list(map(calc_ex,p_))

cnt,res =0,[]
for i in range(2,n):
    cnt = sum(p_[i-k+1:i+1])
    res.append(cnt)

print(max(res))
Problem p02843 (python)

Fixed submission:
X=input()
if len(X)==1:
    s=int(X)
else:
    s=int(X[-1])+int(X[-2])*10
    

b=s//5
b_=s%5
c=b_//4
c_=b_%4
d=c_//3
d_=c_%3
e=d_//2
e_=d_%2
f=e_//1
f_=e_//1

sum=b+c+d+e+f
sum_=105*b+104*c+103*d+102*e+101*f

if sum_>int(X):
    print(0)
else:
    print(1)

Buggy submission (verdict: Runtime Error):
X=input()
s=int(X[-1])+int(X[-2])*10

b=s//5
b_=s%5
c=b_//4
c_=b_%4
d=c_//3
d_=c_%3
e=d_//2
e_=d_%2
f=e_//1
f_=e_//1

sum=b+c+d+e+f
sum_=105*b+104*c+103*d+102*e+101*f

if 2100<int(X):
    print(1)
elif sum_>int(X):
    print(0)
else:
    print(1)

Buggy submission (verdict: Runtime Error):
X=input()
s=int(X[-1])+int(X[-2])*10

b=s//5
b_=s%5
c=b_//4
c_=b_%4
d=c_//3
d_=c_%3
e=d_//2
e_=d_%2
f=e_//1
f_=e_//1

sum=b+c+d+e+f
sum_=105*b+104*c+103*d+102*e+101*f

if sum_>int(X):
    print(0)
else:
    print(1)
Problem p02848 (python)

Fixed submission:
N=int(input())
S=input()
S_=[]
T=['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']

for j in range(len(S)):
    for i in range(len(T)):
        if S[j] == T[i]:
            if i+N>=len(T):
                S_.append(T[i+N-len(T)])
            else:
                S_.append(T[i+N])
            break

y=""
for x in S_:
    y+=x

print(y)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
S_=[]
T=['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']

for j in range(len(S)):
    for i in range(len(T)):
        if S[j] == T[i]:
            S_.append(T[i+N])
            break

print(S_)
Problem p02898 (python)

Fixed submission:
N = input().split()
i = input().split()

count=0
for j in i:
    if(int(j)>=int(N[1])):
        count+=1

print(count)

Buggy submission (verdict: Runtime Error):
N = input().split()
i = [int(input()) for i in range(int(N[0]))]

count=0
for j in i:
    if(j>=int(N[1])):
        count+=1

print(count)
Problem p02923 (python)

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

cnt=0
t=0
for i in range(N-1):
    if h[i]>=h[i+1]:
        t+=1
    else:
        t=0
    cnt=max(cnt,t)
print(cnt)

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

cnt=[]

for i in range(N-1):
    cnt_=0
    while h[i]>=h[i+1]:
        cnt_+=1
        if i==N-2:
            break
        else:
            i+=1
    cnt.append(cnt_)

print(max(cnt))
Problem p02947 (python)

Fixed submission:
import collections as cl
import math
N=int(input())

result_=[]
for i in range(N):
    s= ''.join(sorted(input()))
    result_.append(s)

result=list(cl.Counter(result_).values())

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

ans=0
for j in range(len(result)):
    if result[j]==1:
        continue
    else:
        ans+=combinations_count(result[j],2)

print(ans)

Buggy submission (verdict: Runtime Error):
import math
N=int(input())
s_=[sorted(input()) for i in range(N)]
s_.sort()

l=0
r=1
ans=0
while r < N:
    if s_[l]==s_[r]:
        ans+=math.factorial(r-l)
        r+=1
    else:
        l+=r
        r+=1

print(ans)
Problem p02690 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import math
import sys

X = int(input())

for A in range(-118, 120):
  for B in range(-119, 119):
    val = math.pow(A, 5) - math.pow(B, 5)
    if(val == X):
      print(A, B)
      sys.exit()

Buggy submission (verdict: Runtime Error):
 -*- coding: utf-8 -*-
import math
import sys

X = int(input())

for A in range(-118, 190):
  for B in range(-119, 119):
    val = math.pow(A, 5) - math.pow(B, 5)
    if(val == X):
      print(A, B)
      sys.exit()

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

X = int(input())

for A in range(-118, 190):
  for B in range(-119, 119):
    val = math.pow(A, 5) - math.pow(B, 5)
    if(val == X):
      print(A, B)
      sys.exit(0)
~

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import math
X = int(input())

B = 1
e = 1.0e-10
while True:
  B5 = pow(B, 5)
  A = math.pow(X + B5, 0.2)
  if(abs(A - int(A)) < e):
    print(int(A), B)
    break

  A = math.pow(X - B5, 0.2)
  if(abs(A-int(A)) < e):
    print(int(A), -B)
    break

  B += 1
Problem p03076 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np
T = np.zeros(5, dtype=int)
T[0] = int(input())
T[1] = int(input())
T[2] = int(input())
T[3] = int(input())
T[4] = int(input())
res = np.argsort(T%10)
selected_index = 0
for i in range(5):
  if(T[res[i]]%10 > 0):
    selected_index = res[i]
    break
tim = (T//10 + (T%10 != 0))*10
tim[selected_index] = T[selected_index]
print(sum(tim))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import numpy as np
T = np.zeros(5, dtype=int)
T[0] = int(input())
T[1] = int(input())
T[2] = int(input())
T[3] = int(input())
T[4] = int(input())
res = np.argsort(T%10)
for i in range(5):
  if(T[res[i]]%10 > 0):
    selected_index = res[i]
    break
tim = (T//10 + (T%10 != 0))*10
tim[selected_index] = T[selected_index]
print(sum(tim))
Problem p04011 (python)

Fixed submission:
# -*- coding: utf-8 -*-
# 整数の入力
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

if(N <= K):
  sum = N*X
else:
  sum = K*X + (N-K)*Y

print('%d' %(sum))

Buggy submission (verdict: Runtime Error):
 -*- coding: utf-8 -*-
# 整数の入力
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

if(N <= K):
  sum = N*X
else:
  sum = K*X + (N-K)*Y

print(sum)
Problem p03005 (python)

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

if K == 1:
  out =0
else:
  # 1以外
  nokori = N - K
  mx = nokori + 1
  mn = 1
  out = mx-mn

print(out)

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

if K=1:
   print(0)
else:
   print(N-K)
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 = int(input())
b = int(input())

if a*b % 2 == 0:
    print("Even")
else:
    print("Odd")

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())

if a*b % 2 == 0:
    print("Even")
else:
    print("Odd")

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())

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"

Buggy submission (verdict: Runtime Error):
a = int(raw_input())
b = int(raw_input())

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

Fixed submission:
s=input()
print(s.count("1"))

Buggy submission (verdict: Runtime Error):
s1,s2,s3 = map(int, input().split())
print(s1+s2+s3)

Buggy submission (verdict: Runtime Error):
s1,s2,s3 = map(int, input().split())
print(s1+s2+s3)
Problem p02684 (python)

Fixed submission:
n, k = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]

def find_min_cycle(a):
    memo = {1: 0}
    idx = 0
    cnt = 1

    while a[idx] not in memo:
        memo[a[idx]] = cnt
        cnt += 1
        idx = a[idx]-1

    return memo[a[idx]], cnt-memo[a[idx]], memo

offset, cycle_len, memo = find_min_cycle(a)
rmemo = {v: k for k, v in memo.items()}

if k <= offset:
    print(rmemo[k])
else:
    i = (k-offset)%cycle_len
    print(rmemo[offset+i])

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

def find_min_cycle(a):
    memo = {1: 0}
    idx = 0
    cnt = 1

    while a[idx] not in memo:
        memo[a[idx]] = cnt
        cnt += 1
        idx = a[idx]-1

    return memo[a[idx]], cnt-memo[a[idx]], memo

offset, cycle_len, memo = find_min_cycle(a)
rmemo = {v: k for k, v in memo.items()}

if k <= offset:
    print(memo[k])
else:
    i = (k-offset)%cycle_len
    print(rmemo[offset+i])
Problem p02705 (python)

Fixed submission:
import math
n = int(input())
a = n * 2 * math.pi
print(a)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = n * 2 * math.pi
print(a)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = n * 2 * math.pi
print(a)
Problem p02741 (python)

Fixed submission:
num = [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]
k = int(input())
print(num[k-1])

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

if h * w % 2 == 0:
    ans = h * w / 2
else:
    ans = h * w // 2 + 1

if h == 1 or w == 1:
    ans = 1

print(int(ans))
Problem p02743 (python)

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

if 4 * a * b < (c - a - b) ** 2 and 0 <= c - a - b:
    ans = 'Yes'
else:
    ans = 'No'

print(ans)

Buggy submission (verdict: Runtime Error):
import math

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

if a + b + 2 * math.sqrt(a * b) < c:
    ans = 'Yes'
else:
    ans = 'No'

if math.isclose(math.sqrt(a) + math.sqrt(b), math.sqrt(c)):
    ans = 'Yes'

print(ans)
Problem p03106 (python)

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


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


a_div = make_divisors(a)
b_div = make_divisors(b)
div_list = a_div + b_div

ans = sorted([x for x in set(div_list) if div_list.count(x) > 1])

print(ans[-k])

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


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


a_div = make_divisors(a)
b_div = make_divisors(b)
div_list = a_div + b_div

ans = [x for x in set(div_list) if div_list.count(x) > 1]

print(sorted(ans[-k]))
Problem p03370 (python)

Fixed submission:
n, x = map(int, input().split())
m = [int(input()) for i in range(n)]
rem_donut = x - sum(m)
add_donut = rem_donut // min(m)
print(add_donut + n)

Buggy submission (verdict: Runtime Error):
n, x = list(map(int, input()))
m = [i for i in int(input())]
rem_donut = x - sum(m)
add_donut = rem_donut // min(m)
print(add_donut + n)
Problem p03408 (python)

Fixed submission:
n = int(input())
blu_list = [str(input()) for _ in range(n)]
m = int(input())
red_list = [str(input()) for _ in range(m)]

blu_set_list = list(set(blu_list))
red_set_list = list(set(red_list))
set_list = blu_set_list + red_set_list

blu_cnt = []
red_cnt = []
ans = []

for i in set_list:
    blu_cnt.append(blu_list.count(i))
    red_cnt.append(red_list.count(i))

for i in range(len(set_list)):
    ans.append(blu_cnt[i] - red_cnt[i])

print(max(ans) if max(ans) > 0 else 0)

Buggy submission (verdict: Runtime Error):
n = int(input())
blu_list = [str(input()) for _ in range(n)]
m = int(input())
red_list = [str(input()) for _ in range(m)]

blu_set_list = list(set(blu_list))
red_set_list = list(set(red_list))
set_list = blu_set_list + red_set_list

blu_cnt = []
red_cnt = []
ans = []

for i in set_list:
    blu_cnt.append(blu_list.count(i))
    red_cnt.append(red_list.count(i))

for i in range(len(blu_list)):
    ans.append(blu_cnt[i] - red_cnt[i])

print(max(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
blu_list = [str(input()) for _ in range(n)]
m = int(input())
red_list = [str(input()) for _ in range(m)]

blu_set_list = list(set(blu_list))
red_set_list = list(set(red_list))
set_list = blu_set_list + red_set_list

blu_cnt = []
red_cnt = []
ans = []

for i in set_list:
    blu_cnt.append(blu_list.count(i))
    red_cnt.append(red_list.count(i))

for i in range(len(blu_list)):
    ans.append(blu_cnt[i] - red_cnt[i])

print(max(ans) if max(ans) > 0 else 0)

Buggy submission (verdict: Runtime Error):
n = int(input())
blu_list = [str(input()) for _ in range(n)]
m = int(input())
red_list = [str(input()) for _ in range(m)]

blu_set_list = list(set(blu_list))
red_set_list = list(set(red_list))
set_list = blu_set_list + red_set_list

blu_cnt = []
red_cnt = []
ans = []

for i in set_list:
    blu_cnt.append(blu_list.count(i))
    red_cnt.append(red_list.count(i))

for i in range(len(blu_list)):
    ans.append(blu_cnt[i] - red_cnt[i])

print(max(ans) if max(ans) > 0 else 0)
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")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if (a * b) % 2 == 0:
  print("Even")
  else:
    print("Odd")
Problem p03644 (python)

Fixed submission:
n = int(input())
a = [0]
for i in range(1,n+1):
    cnt = 0
    while i % 2 == 0:
        i //= 2
        cnt += 1
        a.append(cnt)
print(2**max(a))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = []
for i in range(1,n+1):
    cnt = 0
    while i % 2 == 0:
        i //= 2
        cnt += 1
        a.append(cnt)
print(2**max(a))
Problem p02861 (python)

Fixed submission:
import math

N = int(input())

X = [0 for i in range(N)]
Y = [0 for i in range(N)]
for i in range(N):
    x,y = map(int, input().split())
    X[i] = x
    Y[i] = y

D = 0
for i in range(N):
    for j in range(N):
        if i < j:
            a = (X[i]-X[j])**2
            b = (Y[i]-Y[j])**2
            c = math.sqrt(a+b)
            D += c
print((2*D)/N)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())

X = []
Y = []
for i in range(N):
    x,y = map(int, input().split())
    X[i] = x
    Y[i] = y

D = 0
for i in range(N):
    for j in range(N):
        if i < j:
            a = (X[i]-X[j])**2
            b = (Y[i]-Y[j])**2
            c = math.sqrt(a+b)
            D += c
print((2*D)/2)
Problem p03085 (python)

Fixed submission:
b = str(input())

if b == 'A':
    print('T')
elif b == 'T':
    print('A')
elif b == 'G':
    print('C')
elif b == 'C':
    print('G')

Buggy submission (verdict: Runtime Error):
b = str(input())

if b == A:
    print('T')
elif b == T:
    print(A)
elif b == G:
    print(C)
elif b == C:
    print(G)
Problem p03282 (python)

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

ans = 1
index = 0
for j in range(len(S)):
    if S[j] != '1':
        ans = int(S[j])
        index = j
        break

if ans == 1:
    print(ans)
elif index > K-1:
    print(1)
else:
    print(ans)

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

ans = 1
index = 0
for j in range(len(S)):
    if S[j] != '1':
        ans = int(s[j])
        index = j
        break

if ans == 1:
    print(ans)
elif index < K-1:
    print(ans)
else:
    print(1)
Problem p03447 (python)

Fixed submission:
#-*- coding:utf-8 -*-
x = int(input())
a = int(input())
b = int(input())

print((x-a)-b*((x-a)//b))

Buggy submission (verdict: Runtime Error):
#-*- coding:utf-8 -*-
N = int(input())
a1 = []
a2 = []
s,t = 0,0
for i in range(N):
	a1.append(int(input()))
for i in range(N):
	a2.append(int(input()))


for i in range(N-1):
	for j in range(i):
		t += a1[j]
	for k in range(N-1-i):
		t += a2[i+k]
	if t > s:
	    s = t
	t = 0
print(s)

Buggy submission (verdict: Runtime Error):
#-*- coding:utf-8 -*-
x,a,b= int(input())

print((x-a)-b*((x-a)//b))

Buggy submission (verdict: Runtime Error):
#-*- coding:utf-8 -*-
x = input()
a = input()
b = input()

print((x-a)-b*((x-a)//b))

Buggy submission (verdict: Runtime Error):
#-*- coding:utf-8 -*-
x = input()
a = input()
b = input()

print((x-a)//b)
Problem p03449 (python)

Fixed submission:
#-*- coding:utf-8 -*-
N = int(input())
a1 = []
a2 = []
s,t = 0,0

a1 = list(map(int,input().split()))
a2 = list(map(int,input().split()))



for i in range(N):
	for j in range(i+1):
		t += a1[j]
	for k in range(N-i):
		t += a2[i+k]
	if t > s:
	    s = t
	t = 0
print(s)

Buggy submission (verdict: Runtime Error):
#-*- coding:utf-8 -*-
N = int(input())
a1 = []
a2 = []
s,t = 0,0

a1 = [int(input()) for i in range(N)]
a2 = [int(input()) for i in range(N)]


for i in range(N-1):
	for j in range(i):
		t += a1[j]
	for k in range(N-1-i):
		t += a2[i+k]
	if t > s:
	    s = t
	t = 0
print(s)

Buggy submission (verdict: Runtime Error):
#-*- coding:utf-8 -*-
N = int(input())
a1 = []
a2 = []
s,t = 0,0
for i in range(N):
	a1.append(int(input()))
for i in range(N):
	a2.append(int(input()))


for i in range(N-1):
	for j in range(i):
		t += a1[j]
	for k in range(N-1-i):
		t += a2[i+k]
	if t > s:
	    s = t
	t = 0
print(s)

Buggy submission (verdict: Runtime Error):
#-*- coding:utf-8 -*-
N = int(input())
a1,a2 = []
s,t = 0
for i in range(N):
	a1.append(int(input()))
for i in range(N):
	a2.append(int(input()))


for i in range(N-1):
	for j in range(i):
		t += a1[j]
	for k in range(N-1-i):
		t += a2[i+k]
	if t > s:
	    s = t
print s

Buggy submission (verdict: Runtime Error):
#-*- coding:utf-8 -*-
N = int(input())
a1,a2 = []
s,t = 0
for i in range(N):
	a1.append(input())
for i in range(N):
	a2.append(input())


for i in range(N-1):
	for j in range(i):
		t += a1[j]
	for k in range(N-1-i):
		t += a2[i+k]
	if t > s:
	    s = t
print s
Problem p03455 (python)

Fixed submission:
#-*- coding:utf-8 -*-
a = list(map(int,input().split()))


if a[0]*a[1] %2 == 0:
    print("Even")
else: print("Odd")

Buggy submission (verdict: Runtime Error):
#-*- coding:utf-8 -*-
a,b = int(input()),int(input())

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

Fixed submission:
#-*- coding:utf-8 -*-
import math
import sys

t,x,y = [],[],[]
N = int(input())

t.append(0)
x.append(0)
y.append(0)

for i in range(N):
	a, b, c = map(int, input().split())
	t.append(a)
	x.append(b)
	y.append(c)

for i in range(N):
	T = t[i+1]-t[i]
	Z = abs(x[i+1]-x[i])+abs(y[i+1]-y[i])
	if (T < Z) or ((T%2) != (Z%2)):
		print("No")
		sys.exit()
print("Yes")

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

t,x,y = [],[],[]
N = int(input())

for i in range(N):
	a, b, c = map(int, input().split())
	t.append(a)
	x.append(b)
	y.append(c)

for i in range(N):
	T = t[i+1]-t[i]
	Z = abs(x[i+1]-x[i])+abs(y[i+1]-y[i])
	if (T < Z) or ((T%2) != (Z%2)):
		print("No")
		sys.exit()
print("Yes")