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

Fixed submission:
n,a,b = map(int, input().split())
cnt = 0

def digidsum(x):
  s = str(x)
  array_list = list(map(int,s))
  return sum(array_list)



for i in range(n):

  if digidsum(i+1) >= a and digidsum(i+1) <= b:
    cnt += i+1
    
print(cnt)

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

def digidsum(x):
  s = str(n)
  array_list = list(map(int,s))
  return sum(array_list)



for i in range(n):
  if sum(i+1) >= a and sum(i+1) <= b:
    cnt += i
print(cnt)
Problem p03494 (python)

Fixed submission:
n = input()
A = list(map(int,input().split()))
ans=float("inf")

for i in A:
  ans = min(ans, len(bin(i))-bin(i).rfind("1")-1)
  
print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
A = list(map(int,input().split()))
ans = float("inf")

for i in A:
  ans = min(ans, len(bin(i))-bin(i).rfind("1")-)
print(ans)
Problem p03494 (python)

Fixed submission:
input()
A = list(map(int, input().split()))
count = 0
while all(a % 2 == 0 for a in A):
    A = [a/2 for a in A]
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
input()
A = list(map(int, input().split))
count = 0
while all(a % 2 == 0 for a in A):
    A = [a/2 for a in A]
    count += 1
print(count)

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

while all(a % 2 == 0 for a in A):
    A = [a/2 for a in A]
    count += 1
print(count)
Problem p03448 (python)

Fixed submission:
A, B, C, X = [int(input()) for _ in range(4)]
print(sum(500*a + 100*b + 50*c == X for a in range(A+1) for b in range(B+1) for c in range(C+1)))

Buggy submission (verdict: Runtime Error):
A, B, C, X = [int(input()) for _ in range(4)]
print(sum(500*a + 100*b + 50*c == X for a in A for b in B for c in C))

Buggy submission (verdict: Runtime Error):
A, B, C, X = [int(input()) for i in range(4)]

print(sum(500*a + 100*b + 50*c == X) for a in A for b in B for c in C)
Problem p03448 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
i1, i2, i3 = 0, 0, 0
m1, m2, m3, p = 0, 0, 0, 0
while i1 <= a:
  m1 = 500 * i1
  while i2 <= b:
    m2 = m1 + 100 * i2
    while i3 <= c:
      m3 = m2 + 50 * i3
      if m3 < x:
        i3 += 1
        continue
      elif m3 > x:
        break
      else:
        p += 1
        break
    i3 = 0
    i2 += 1
  i2 = 0
  i1 += 1
print(p)

Buggy submission (verdict: Runtime Error):

b = int(input())
c = int(input())
x = int(input())
i1, i2, i3 = 0, 0, 0
m, p = 0, 0
while i1 <= a:
  while i2 <= b:
    while i3 <= c:
      m = 500 * i1 + 100 * i2 + 50 * i3
      if m == x:
        p += 1
      i3 += 1
    i3 = 0
    i2 += 1
  i2 = 0
  i1 += 1
print(p)
Problem p03455 (python)

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

c = (a * b) % 2

if c == 0:
    print("Even")
elif c == 1:
    print("Odd")

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

d = (a * b)
e = d % 2

if e = 0:
    print("Even")
else e = 1:
    print("Odd")

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

d = (a * b) % 2

if d = 0:
    print("Even")
else:
    print("Odd")
Problem p03493 (python)

Fixed submission:
a = input()

count = 0

for i in range(3):
    temp = a[i]
    if temp == "1":
        count = count + 1

print(count)

Buggy submission (verdict: Runtime Error):
li = list(map(input().split()))

count = 0

for i in range(3):
    if li[i] == "1":
        count = count + 1

print(count)

Buggy submission (verdict: Runtime Error):
li = stdin.readline().rstrip()
count = 0

for i in range(3):
    if li[i] == "1":
        count = count + 1

print(count)

Buggy submission (verdict: Runtime Error):
li = stdin.readline().rstrip()
count = 0

for i in range(2):
    if li[i] == "1":
        count = count + 1

print(count)

Buggy submission (verdict: Runtime Error):
li = list(str,map(input().split()))
count = 0

for i in range(3):
    if li[i] == "1":
        count = count + 1

print(count)

Buggy submission (verdict: Runtime Error):
li = list(str.map(input().split()))
count = 0

for i in range(3):
    if li[i] == "1":
        count = count + 1

print(count)

Buggy submission (verdict: Runtime Error):
li = list(map(input().split()))
count = 0

for i in range(3):
    if li[i] == "1":
        count = count + 1

print(count)

Buggy submission (verdict: Runtime Error):
li = list(map(input().split()))
count = 0

for i in range(3):
    if li[i] == "a":
        count = count + 1

print(count)
Problem p03720 (python)

Fixed submission:
n, m = map(int, input().split())
info = list()
for i in range(0, n + 1):
    info.append(0)
for i in range(0, m):
    a, b = map(int, input().split())
    info[a] = info[a] + 1
    info[b] = info[b] + 1
for i, value in enumerate(info):
    if i is not 0:
        print(value)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
s = ""
[s += input() for i in range(0, m)]
[print(s.count(str(i))) for i in range(1, m + 1)]
Problem p03493 (python)

Fixed submission:
str = input()
count = 0
for char in str:
  if char == '1':
    count += 1

print(count)

Buggy submission (verdict: Runtime Error):
import itertools

cnt_500 = int(input())
cnt_100 = int(input())
cnt_50 = int(input())
target_amount = int(input())

cnt_500_arr = [i for i in range(cnt_500+1)]
cnt_100_arr = [i for i in range(cnt_100+1)]
cnt_50_arr = [i for i in range(cnt_50+1)]

coin_combinations = list(itertools.product(cnt_500_arr, cnt_100_arr, cnt_50_arr))

result_count = 0
for cnt_500, cnt_100, cnt_50 in coin_combinations:
	amount = cnt_500 * 500 + cnt_100 * 100 + cnt_50 * 50
	if amount == target_amount:
		result_count += 1
print(result_count)
Problem p03455 (python)

Fixed submission:
input_int = list(map(int,input().split()))
 
if input_int[0] * input_int[1] % 2 == 0 :
   print("Even")
else:
  print("Odd")

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

if (input_int[0] * input_int[1]) % 2 == 0 {
  print("Even")
else{
  print("Odd")
}
Problem p03493 (python)

Fixed submission:
s = input()

s1,s2,s3 = s[0:1],s[1:2],s[2:3]

i= 0 

if int(s1) == 1:
  i += 1
if int(s2) == 1:
  i += 1
if int(s3) == 1:
  i += 1
  
print(i)

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

def iseven(i,num_list):
  count = 0
  for num in num_list:
    if num % 2 != 0:
      return False
  return True

num_divided = 0

while iseven(n,a) :
  a = list(map(lambda x: x / 2, a ))
  num_divided += 1

print(num_divided)
Problem p03493 (python)

Fixed submission:
print raw_input().count('1')

Buggy submission (verdict: Runtime Error):
num = int(raw_input())
list = map(int, raw_input().split())

i = 0
while 1 not in map(lambda x: x % 2, list):
 list = map(lambda x: x >> 1, list)
 i += 1

print i
Problem p03493 (python)

Fixed submission:
i = input()
a = [int(i) for i in str(i)]

s = a[0]+a[1]+a[2]
print(s)

Buggy submission (verdict: Runtime Error):
i =int(input())
a = [int(i) for i in str(i)]

s = a[0]+a[1]+a[2]
print(s)
Problem p03455 (python)

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

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

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

Fixed submission:
n = input()
a = list(map(int, input().split()))
cnt = 0
while all(i%2==0 for i in a):
    a = [i/2 for i in a]
    cnt += 1
print(cnt)

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

import sys

while True:
    for i in range(N):
        if a[i] % 2 == 0:
            a[i] = a[i]/2
        else:
            print(t)
            sys.exit()
    t += 1
Problem p03729 (python)

Fixed submission:
def is_shiritori(s):
    before_mozi = None
    for mozi in s.split():
        if before_mozi is None:
            before_mozi = mozi
            continue
        else:
            if mozi[0] is not before_mozi[-1]:
                print("NO")
                return False
            before_mozi = mozi
    print("YES")

ss = input()
is_shiritori(ss)

Buggy submission (verdict: Runtime Error):
def sentou(NT, ts):
    N, T = map(int, NT.split())
    before_oshitano = None
    total_s = 0
    for t in map(int, ts.split()):
        if before_oshitano is None:
            before_oshitano = t
            continue
        elif T > (t - before_oshitano):
            total_s += t - before_oshitano
        else:
            total_s += T
        before_oshitano = t
    total_s += T

    print(total_s)


# sentou("9 10", "0 3 5 7 100 110 200 300 311")
sentou(input(), input())
Problem p03494 (python)

Fixed submission:
import numpy as np
n=int(input())
a=map(int, input().split())
b=[]

for i in a:
    b.append(i)

b=np.array(b)
c=0

while all(b%2==0):
    b=b/2
    c += 1
    
print(c)

Buggy submission (verdict: Runtime Error):
import numpy as np
n=int(input())
a=[map(int, input().split())]
b=np.array(a)

c=0

while all(b%2==0):
    b=b/2
    c += 1
    
print(c)
Problem p03448 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
counter = 0

list_500 = list(range(A+1))
five_hundred_list = [n*500 for n in list_500]

list_100 = list(range(B+1))
one_hundred_list = [n*100 for n in list_100]

list_50 = list(range(C+1))
fifty_list = [n*50 for n in list_50]

for fh in range(len(five_hundred_list)):
    for oh in range(len(one_hundred_list)):
      for f in range(len(fifty_list)):
        if five_hundred_list[fh] + one_hundred_list[oh] + fifty_list[f] == X:
          counter += 1

print(counter)

Buggy submission (verdict: Runtime Error):
list_500 = list(range(A+1))
list_100 = list(range(B+1))
list_50 = list(range(C+1))

for fh in range(len(list_500)):
    for oh in range(len(list_100)):
      for f in range(len(list_50)):
        if list_500[fh] * 500 + list_100[oh] * 100 + list_50[f] * 50 == X:
          counter += 1

print(counter)
Problem p03455 (python)

Fixed submission:
input = input().rstrip().split()
if int(input[0]) % 2 == 0 or int(input[1]) % 2 == 0:
  print('Even')
else:
  print('Odd')

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
answer = a * b
if answer % 2 ==1:
  return 'Odd'
else:
  return 'Even'

Buggy submission (verdict: Runtime Error):
def main(a,b):
  answer = a * b
  if answer % 2 ==1:
    return 'Odd'
  else:
    return 'Even'

a = int(input())
b = int(input())

main(a,b)

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

answer = a * b
print(answer)
if answer % 2 ==1:
  print('Odd')
else:
  print('Even')
Problem p03493 (python)

Fixed submission:
in1 = int(raw_input())
a = in1 // 100
b = (in1 - a * 100) // 10
c = in1 % 10

cnt = 0
if a == 1:
    cnt += 1
if b == 1:
    cnt += 1
if c == 1:
    cnt += 1

print cnt

Buggy submission (verdict: Runtime Error):
in = int(raw_input())
a = in // 100
b = (in - a * 100) // 10
c = in % 10

cnt = 0
if a == 1:
  cnt += 1
elif b == 1:
  cnt += 1
elif c == 1:
  cnt += 1
  
print cnt
Problem p03455 (python)

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

Buggy submission (verdict: Runtime Error):
if a*b % 2 == 0:
  print('Even')
else:
  print('Odd')

Buggy submission (verdict: Runtime Error):
if a*b % 2 == 0:
  return 'Even'
else:
  return 'Odd'
Problem p03478 (python)

Fixed submission:
n,a,b=map(int,input().split())
print(sum(i for i in range(n+1) if a<=sum(map(int,str(i)))<=b))

Buggy submission (verdict: Runtime Error):
a = list(map(int,input()))
N = a[0]
A = a[1]
B = a[2]
ans = []
for a in range(10):
  for b in range(10):
    for c in range(10):
      for d in range(10):
        for e in range(10):
          if 10000*a+1000*b+100*c+10*d+e <= N and a+b+c+d+e >=A and a+b+c+d+e <= B:
            ans.append(10000*a+1000*b+100*c+10*d+e)
print(len(ans))
Problem p03455 (python)

Fixed submission:
numbers = input().split(" ")
a= int(numbers[0])
b= int(numbers[1])
c=a*b
if c%2==0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
numbers = int(input().split(" "))
a = numbers[0]
b = numbers[1]
c = a*b
if c%2==0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
numbers = input().split(" ")
a = numbers[0]
b = numbers[1]
c = a*b
if c%2==0:
  print("Even")
elif c%2==1:
  print("Odd")

Buggy submission (verdict: Runtime Error):
numbers = input().split(" ")
a = numbers[0]
b = numbers[1]
c = a*b
if c%2==0:
  print("Even")
elif c%2==0:
  print("Odd")

Buggy submission (verdict: Runtime Error):
numbers=input().split(" ")
a=numbers[0]
b=numbers[1]
c=a*b
if c%2==0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
a = input()
a = int(a)
b = input()
b = int(b)
if ((a*b)%2) == 0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
a = input()
a = int(a)
b = input()
b = int(b)
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 = input()
b = input()
if a*b //2 == 0 :
  print("Even")
else:
  print("Odd")
Problem p03493 (python)

Fixed submission:
number = int(input())
count = 0
if number >= 50:
  count += 1
if number%100 >= 5:
  count += 1
if number%10 >= 0.5:
  count += 1
print(count)

Buggy submission (verdict: Runtime Error):
M = int(input())
N = M[0]
count = 0
if N >= 50:
  count+=1
  N-=100
if if N >=5:
  count+=1
  N-=10
if N>0.5:
  count+=1;
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input().split())
count = 0
if N >= 50:
  count+=1
  N-=100
if if N >=5:
  count+=1
  N-=10
if N>0.5:
  count+=1;
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
count = 0
COUNT = 0
A = [int(i) for i in input().split()]
while 1:
  for i in range(N):
    if A[i]%2==0:
      A[i]/=2
      count+=1
  if count == N:
    COUNT+=1
    count = 0
  else:
    break
print(COUNT)

Buggy submission (verdict: Runtime Error):
N = int(input())
count = 0
COUNT = 0
A = [int(i) for i in input().split()]
while 1:
  for i in range(N):
    if A[i]%2==0:
      A[i]/=2
      count+=1
  if count == N:
    COUNT+=1
  else:
    break
print(COUNT)

Buggy submission (verdict: Runtime Error):
N = input()
count = 0
COUNT = 0
A = input().split()
while:
  for i in range(N):
    if A[i]%2==0:
      A[i]/=2
      count++
  if count == N:
    COUNT++
  else:
    break
print(COUNT)

Buggy submission (verdict: Runtime Error):
numbers = int(input())
numbers = string(numbers)
count = 0
if numbers[0]=='1':
  count += 1
if numbers[1]=='1':
  count += 1
if numbers[2]=='1':
  count += 1
print(count)

Buggy submission (verdict: Runtime Error):
numbers = input()
numbers = string(numbers)
count = 0
if numbers[0]=='1':
  count += 1
if numbers[1]=='1':
  count += 1
if numbers[2]=='1':
  count += 1
print(count)
Problem p03494 (python)

Fixed submission:
N = int(input())
count = 0
COUNT = 0
A = [int(i) for i in input().split()]
while 1:
  for i in range(N):
    if A[i]%2==0:
      A[i]/=2
      count+=1
  if count == N:
    COUNT+=1
    count = 0
  else:
    break
print(COUNT)

Buggy submission (verdict: Runtime Error):
N = input()
A = [int(i) for i in input().split()]
count = 0
COUNT = 0
while 1:
  for i in range(N):
    if A[i]%2==0:
      A[i]/=2
      count+=1
  if count == N:
    COUNT+=1
    count=0
  else:
    break
  print(COUNT)
Problem p03478 (python)

Fixed submission:
n,a,b=map(int,input().split())
print(sum(i for i in range(n+1) if a<=sum(map(int,str(i)))<=b))

Buggy submission (verdict: Runtime Error):
arr = list(map(int, input().split()))
au = sum(i for in range(arr[0]) if arr[1] <= sum(map(int, str(i))) <= arr[2])
print(au)
Problem p03494 (python)

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
bol = 0
count =0

while(1):
  for num  in a:
    if num  % 2 == 1:
      bol = 1

  if bol == 0:
        a = [ i	/2 for i in a]
        count += 1
  else:
          break

print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
bol = 0
count =0

while(1):
    for num  in a:
		if num  % 2 == 1:
		    bol = 1

    if bol == 0:
		a = [ i	/2 for i in a]
		count += 1
    else :
		break

print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
bol = 0
count =0

while(1):
    for num  in a:
	if num  % 2 == 1:
	    bol = 1

    if bol == 0:
	a = [ i	/2 for i in a]
	count += 1
    else :
	break

print(count)
Problem p03455 (python)

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

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

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

Buggy submission (verdict: Runtime Error):
if a*b%2 == 0:
    print("Even")
else:
    print("Odd")

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

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

Fixed submission:
allnum = str(input())
x = 0
for i in range(3):
    
  if allnum[i] == "1":
    x = x+1
  else:
    x = x

print(x)

Buggy submission (verdict: Runtime Error):
print(input().count(1))
Problem p03638 (python)

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

c = [0]*N
n = 0
sign = 1
for h in range(H):
    state = [0]*W
    for w in range(W):
        if c[n]>=a[n]:
            n += 1
        state[w] = str(n+1)
        c[n] += 1
    sign = (sign+1)%2
    if sign:
        state = state[::-1]
    print(' '.join(state))

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

c = [0]*len(a)
n = 0
sign = 1
for h in range(H):
    state = [0]*W
    for w in range(W):
        if c[n]>=a[n]:
            n += 1
        state[w] = str(n+1)
        c[n] += 1
    sign = (sign+1)%2
    if sign:
        state = state[::-1]
    print(' '.join(state))

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

c = [0]*len(a)
n = 0
sign = 1
for h in range(H):
    state = [0]*W
    for w in range(W):
        if c[n]>=a[n]:
            n += 1
        state[w] = str(n+1)
        c[n] += 1
    sign = (sign+1)%2
    if sign:
        state = state[::-1]
    print(' '.join(state))
Problem p03573 (python)

Fixed submission:
a,b,c=map(int,input().split(" "))
if a == b:
  print(c)
elif a == c:
  print(b)
else:
  print(a)

Buggy submission (verdict: Runtime Error):
k,s=map(int,input().split(" "))
ans=0
for x in range(k+1):
  for y in range(x, k+1):
    for z in range(y, k+1):
      t = x+y+z
      if t == s:
        ans += 1
print(ans)
Problem p03456 (python)

Fixed submission:
import math
s = int(input().replace(' ',''))

if math.sqrt(s) == int(math.sqrt(s)):
	print('Yes')

else:
	print('No')

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

count = 0

for i in range(1, c+1):

    if (i * 50) > x:
        break

    for j in range(1, b+1):

        if ((j * 100) > x):
            break

        for k in range(1, a+1):
            result = (i * 50) + (j * 100) + (k * 500)

            if (result == x):
                count += 1

            if (k * 500) > x:
                break

print(count)
Problem p03455 (python)

Fixed submission:
a,b=map(int,input().split())
c=a*b
if(c%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 p04043 (python)

Fixed submission:
ans=list(map(int,input().split()))
dic={}
flg=0
for x in ans:
    if(x!=5 and x!=7):
        flg=-1
        break
    else:
        dic[str(x)]=dic.get(str(x),0)+1
if(flg==-1):
    print("NO")
else:
    if(dic["5"]!=2 or dic["7"]!=1):
	       print("NO")
    else:
 	      print("YES")

Buggy submission (verdict: Runtime Error):
ans=list(map(int,input().split()))
dic=[]
for x in ans:
  if(x!=5 or x!=7):
    print("NO")
    break
  else:
  	dic[str(x)]=dic.get(str(x),0）+1
if(dic["5"]!=2 and dic["7"]!=1):
	print("NO")
else:
  	print("YES")

Buggy submission (verdict: Runtime Error):
ans=list(map(int,input().split()))
dic=[]
for x in ans:
  if(x!=5 or x!=7):
    print("NO")
    break
  else:
  	dic[str(x)]=dic.get(x，0）+1
if(dic["5"]!=2 and dic["7"]!=1):
	print("NO")
else:
  	print("YES")
Problem p03451 (python)

Fixed submission:
def find_max(n, grid):
    def helper(idx, cur_max, down):
        if n > (idx + 1):
            if down:
                return helper(idx + 1, cur_max + grid[1][idx], down)
            else:
                return max(helper(idx + 1, cur_max + grid[1][idx], True), helper(idx + 1, cur_max + grid[0][idx + 1], False))
        else:
            return cur_max + grid[1][idx]

    return helper(0, grid[0][0], False)

n = int(input())
candie_matrix = []
for i in range(2):
    row = list(map(int, input().split()))
    if len(row) != n:
        print("wrong inputs")

    candie_matrix.append(row)

print(find_max(n,candie_matrix))

Buggy submission (verdict: Runtime Error):
def find_max(n, grid):
    def helper(idx, cur_max, down):
        if n > (idx + 1):
            if down:
                return helper(idx + 1, cur_max + grid[1][idx], down)
            else:
                return max(helper(idx + 1, cur_max + grid[1][idx], True), helper(idx + 1, cur_max + grid[0][idx + 1], False))
        else:
            return cur_max + grid[1][idx]

    return helper(0, grid[0][0], False)

n = int(input())
candie_matrix = []
for i in range(2):
    row = list(map(int, input().split()))
    if len(row) != n:
        print("wrong inputs")
        return;

    candie_matrix.append(row)

find_max(n,candie_matrix)
Problem p03487 (python)

Fixed submission:
N=int(input())
a=list(map(int,input().split()))
cnt={}
for e in a:
  if e in cnt:
    cnt[e]+=1
  else:
    cnt[e]=1
ans=0
for e in a:
  if cnt[e]==0:
    continue
  else:
    if cnt[e] > e:
      ans+=cnt[e]-e
    elif cnt[e] < e:
      ans+=cnt[e]
    cnt[e]=0
print(ans)

Buggy submission (verdict: Runtime Error):
cnt={}
for e in a:
  if e in cnt:
    cnt[e]+=1
  else:
    cnt[e]=1
ans=0
for e in a:
  if cnt[e]==0:
    continue
  else:
    if cnt[e] > e:
      ans+=cnt[e]-e
    elif cnt[e] < e:
      ans+=cnt[e]
    cnt[e]=0
print(ans)
Problem p04029 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(input())
print(int(n*(n+1)/2)
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())
c = a * b

if c % 2 == 0:
  return "Even"
else:
  return "Odd"
Problem p03485 (python)

Fixed submission:
#82
a,b=map(int,input().split())
import math
print(math.ceil((a+b)/2))

Buggy submission (verdict: Runtime Error):
s=list(input())
t=list(input())
sv=sorted(s)
tv=sorted(t)
if sv<tv:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import math
a,b=input().split()
print(math.ceil(a+b/2))
Problem p03543 (python)

Fixed submission:
#79
n=list(input())
if (n[0]==n[1]==n[2] or n[1]==n[2]==n[3]):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
#79
n=list(input())
if (n[0]n[1]n[2] or n[0]n[2]n[3] or n[0]n[1]n[3] or n[1]n[2]n[3]):
    print('Yes')
else:
    print('No')
Problem p03544 (python)

Fixed submission:
#79B
N=int(input())
data=[2]
data.append(1)
for i in range(2,N+1):
    data.append(data[i-1]+data[i-2])
    
print(data[N])

Buggy submission (verdict: Runtime Error):
#79B
N=int(input())
import ita
data=ita.array.make1d(N+1)
data[0]=2
data[1]=1
for i in range(2,N+1):
    data[i]=data[i-1]+data[i-2]
print(data[N])

Buggy submission (verdict: Runtime Error):
N=int(input())
import ita
data=ita.array.make1d(N+1)
data[0]=2
data[1]=1
for i in range(2,N+1):
    data[i]=data[i-1]+data[i-2]
print(data[N])