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

Fixed submission:
A, B, T  =  (int(_) for _ in input().split())
ans = (T + 0.5) // A
ans = int(ans * B )
print(ans)

Buggy submission (verdict: Runtime Error):
A, B, T = input()
ans = ((T + 0.5) // A) * B
print(ans)

Buggy submission (verdict: Runtime Error):
Main.py
A, B, T = input()
n = (T + 0.5) // A
tot_biscuits = B * n
print(int(tot_biscuits))

Buggy submission (verdict: Runtime Error):
Main.py
A, B, T = input()
n = (T + 0.5) // A
tot_biscuits = B * n
print(tot_biscuits)
Problem p03061 (python)

Fixed submission:
from fractions import *

n, *a = map(int, open(0).read().split())
b = [0]
for i in a:
    b += gcd(b[-1], i),
w = m = 0
for i in range(n):
    m = max(m, gcd(w, b[-i - 2]))
    w = gcd(w, a[~i])
print(m)

Buggy submission (verdict: Runtime Error):
import math as mt

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


def solve(n: int, a: list):
    lgcd = [0] * (n - 1)
    lgcd[0] = a[0]
    for i in range(1, n - 1):
        lgcd[i] = mt.gcd(a[i], lgcd[i - 1])
    a.reverse()

    rgcd = [0] * (n - 1)
    rgcd[0] = a[0]
    for i in range(1, n - 1):
        rgcd[i] = mt.gcd(a[i], rgcd[i - 1])
    a.reverse()

    ans = [0] * n
    ans[0] = rgcd[n - 2]
    ans[n - 1] = lgcd[n - 2]
    for i in range(1, n):
        ans[i] = mt.gcd(lgcd[i - 1], rgcd[n - 2 - i])

    return max(ans)


print(solve(N, A))
Problem p03238 (python)

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

Buggy submission (verdict: Runtime Error):
def make_divisor_list(num):
    if num < 1:
        return []
    elif num == 1:
        return [1]
    else:
        divisor_list = []
        divisor_list.append(1)
        for i in range(2, num // 2 + 1):
            if num % i == 0:
                divisor_list.append(i)
        divisor_list.append(num)

        return divisor_list

N,M=list(map(int,input().split()))
LIST=[]
divide_list = make_divisor_list(M)
if M%N==0:
    print(M//N)
else:
    x = M/N
    for i in divide_list:
       if i <= x:
          LIST.append(i)
    print(max(LIST))
Problem p03264 (python)

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

Buggy submission (verdict: Runtime Error):
x_1,y_1,x_2,y_2 = list(map(int,input().split()))

A = x_2 - x_1 
B = y_2 - y_1

print(x_2-B,y_2+A,x_1-B,y_1+A)
Problem p03282 (python)

Fixed submission:
S = input()
K = input()
count = 0
for i in range(len(S)):
    if S[i]=="1":
        count+=1
    else:
        break
        
print(1) if int(K) <= count else print(S[count])

Buggy submission (verdict: Runtime Error):
S = input()
K = input()
count = 0
for i in range(len(S)):
    if S[i]=="1":
        count+=1
    else:
        break
        
print(1) if K <= count else print(S[count])
Problem p03284 (python)

Fixed submission:
A,B = list(map(int,input().split()))
print(1) if A%B!=0 else print(0)

Buggy submission (verdict: Runtime Error):
import collections
from collections import defaultdict
import numpy as np

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

A = np.array(A,dtype='int64')
C = np.append([0],np.cumsum(A))
#累積和を算出して最初に０をつける。
L = [i%M for i in C]
#Ｍで割ったあまりを求めてリスト化
d = defaultdict(int)
for i in L:
    d[i] +=1
#各余りに対して、その数が何個あるかを求める。

ans = 0
for i in d.values():
    S = i * (i-1) / 2
    ans+=S
    
print(int(ans))
Problem p03060 (python)

Fixed submission:

def problem():
    N = int(input())
    V = list(map(int, input().split()))
    C = list(map(int, input().split()))

    print(algorithm(N, V, C))


def algorithm(N, V, C):
    indices = list(filter(lambda i: V[i] - C[i] > 0, list(range(0, N))))

    sum = 0
    for i in indices:
        sum += V[i] - C[i]
    return sum

problem()

Buggy submission (verdict: Runtime Error):
from typing import List

def problem():
    N = int(input())
    V = list(map(int, input().split()))
    C = list(map(int, input().split()))
 
    print(algorithm(N, V, C))
 
 
def algorithm(N: int, V: List[int], C: List[int]):
    indices = list(filter(lambda i: V[i] - C[i] > 0, list(range(0, N))))
 
    sum = 0
    for i in indices:
        sum += V[i] - C[i]
    return sum
 
problem()

Buggy submission (verdict: Runtime Error):

def problem():
    N = int(input())
    V = list(map(int, input().split()))
    C = list(map(int, input().split()))

    print(algorithm(N, V, C))


def algorithm(N: int, V: List[int], C: List[int]):
    indices = list(filter(lambda i: V[i] - C[i] > 0, list(range(0, N))))

    sum = 0
    for i in indices:
        sum += V[i] - C[i]
    return sum
 
problem()
Problem p03162 (python)

Fixed submission:

import sys


def problem():
    N = int(input())
    activityList = []
    for i in range(N):
      row = list(map(int, input().split()))
      activityList.append(row)

    print(algorithm(N,activityList))

def algorithm(N, activityList):
  dp = [[0, 0, 0] for i in range(N+ 1)]

  for index in range(1, N + 1):
    for j in range(3):
      for k in range(3):
        if j == k:
          continue
        if dp[index][j] < dp[index - 1][k] + activityList[index-1][j]:
          dp[index][j] = dp[index - 1][k] + activityList[index-1][j]
      
  return max(dp[N])

problem()

Buggy submission (verdict: Runtime Error):

import sys

intMaxValue = sys.maxsize


def problem():
    N = int(input.split())
    activityList = []
    for i in range(N):
      row = list(map(int, input().split()))
      activityList.append(row)

    print(algorithm(N,activityList))

def algorithm(N, activityList):
  dp = [[0, 0, 0] for i in range(N+ 1)]

  for index in range(1, N + 1):
    for j in range(3):
      for k in range(3):
        if j == k:
          continue
        if dp[index][j] < dp[index - 1][k] + activityList[index-1][j]:
          dp[index][j] = dp[index - 1][k] + activityList[index-1][j]
      
  return max(dp[N])


problem()
Problem p03399 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = min(A,B)
F = min(C,D)
print(E+F)

Buggy submission (verdict: Runtime Error):
N = list(map(int, input().split()))
min_train = min(N[0],N[1])
min_bus = min(N[2],N[3])
print(min_train+ min_bus)
Problem p03455 (python)

Fixed submission:
a = list(map(int, input().split()))
if a[0]*a[1]%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')
Problem p03485 (python)

Fixed submission:
N = list(map(int, input().split()))
d = N[0]+N[1]
if d%2==0:
    print(d//2)
else:
    print(d//2+1)

Buggy submission (verdict: Runtime Error):
N = list(map(int, input().split()))
if (N[0]+N[1])%2==0:
    print((N[0]+N[1])//2)
else:
    print(()(N[0]+N[1])//2)+1)

Buggy submission (verdict: Runtime Error):
N = list(map(int, input().split()))
if (N[0]+N[1])%2==0:
    print((N[0]+N[1])//2)
else:
    print(()(N[0]+N[1])//2)+1)
Problem p03076 (python)

Fixed submission:
# B - Five Dishes

n = []
for _ in range(5):
    n.append(int(input()))

time = 0
mini = 10
for x in n:
    rest = x%10
    if rest != 0:
        mini = min(rest, mini)
    while x%10 != 0:
        x += 1
    time += x
print(time-10+mini)

Buggy submission (verdict: Runtime Error):
# B - Five Dishes
import math

n = []
for _ in range(5):
    n.append(int(input()))

mini = 10
for y, x in enumerate(n):
    rest = x % 10 
    if rest != 0:
        if rest < mini:
            mini = rest
            mini_num = y 
            
time = n.pop(mini_num)
for x in n:
    if x % 10 != 0:
        item = math.ceil(x/10)*10
        time += item
    elif x%10 == 0:
        time += x
    
print(time)

Buggy submission (verdict: Runtime Error):
# B - Five Dishes

n = []
for _ in range(5):
    n.append(int(input()))

mini = 10
for y, x in enumerate(n):
    rest = x % 10 
    if rest != 0:
        if rest < mini:
            mini = rest
            mini_num = y 
            
time = n.pop(mini_num)
for x in n:
    if x % 10 != 0:
        item = math.ceil(x/10)*10
        time += item
    elif x%10 == 0:
        item = x
        time += item
    
print(time)

Buggy submission (verdict: Runtime Error):
# B - Five Dishes

n = []
for _ in range(5):
    n.append(int(input()))

mini = 10
for y, x in enumerate(n):
    rest = x % 10 
    if rest != 0:
        if rest < mini:
            mini = rest
            mini_num = y 
            
time = n.pop(mini_num)
for x in n:
    if x % 10 != 0:
        item = math.ceil(x/10)*10
        time += item
    else:
        item = x
        time += item
    
print(time)

Buggy submission (verdict: Runtime Error):
# B - Five Dishes

n = []
for _ in range(5):
    n.append(int(input()))

mini = 10
for y, x in enumerate(n):
    rest = x % 10 
    if rest != 0:
        if rest < mini:
            mini = rest
            mini_num = y 
            
time = n.pop(mini_num)
for x in n:
    if x % 10 != 0:
        item = x + (10-x%10)
        time += item
    else:
        item = x
        time += item
    
print(time)

Buggy submission (verdict: Runtime Error):
# B - Five Dishes

n = []
# n = [29, 20, 7, 35, 120]
for _ in range(5):
    n.append(int(input()))

mini = 10
for y, x in enumerate(n):
    rest = x % 10 
    if rest != 0:
        if rest < mini:
            mini = rest
            mini_num = y 
            
# print(mini)
# print(mini_num)

# print(n.pop(mini_num))

time = n.pop(mini_num)
print(n)
for x in n:
    if x % 10 != 0:
        item = x + (10-x%10)
        time += item
    else:
        item = x
        time += item
#     print('item:', item)
#     print(time)
    
print(time)
Problem p03059 (python)

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

Buggy submission (verdict: Runtime Error):
A, B, T = input().split()
print((T/A)*B)

Buggy submission (verdict: Runtime Error):
A, B, T = input().split( )
print(int(T/A)*B)

Buggy submission (verdict: Runtime Error):
A, B, T = input().split()
print(int(T/A)*B)
Problem p03076 (python)

Fixed submission:
time=[]
for i in range(5):
  time.append(int(input()))

num=[]
min=10
  
for list in time:
  if list%10==0:
    num.append(list)
  else:
    num.append(list+(10-list%10))
    if min>list%10:
      min=list%10

print(sum(num)-(10-min))

Buggy submission (verdict: Runtime Error):
time=[]
for i in range(5):
  time.append(input())

num=[]
min=10
  
for list in time:
  if list%10==0:
    num.append(list)
  else:
    num.append(list+(10-list%10))
    if min>list%10:
      min=list%10

print(sum(num)-(10-min))
Problem p03323 (python)

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

if (a > 8 or b>8):
    print(":(")
else:
    print("Yay!")

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

if (a > 8 or b>8):
    print(":(")
else
    print("Yay!")
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, input().split)
print(T//A*B)
Problem p03071 (python)

Fixed submission:
A, B = map(int, input().split())
if A == B:
  print(A+B)
elif A > B:
  print(A*2-1)
else:
  print(B*2-1)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
if A == B:
  print(A　+　B)
elif A > B:
  print(A　*　2　-　1)
else:
  print(B　*　2　-　1)
Problem p03105 (python)

Fixed submission:
A, B, C = map(int, input().split())
print(min(C, B//A))

Buggy submission (verdict: Runtime Error):
A, B, C = map(int, input().split)
print(min(C, B//A)
Problem p03210 (python)

Fixed submission:
X = int(input())
if X == 7:
  print('YES')
elif X == 5:
  print('YES')
elif X == 3:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
X = int(input())
	if X in [7, 5, 3]:
    	print('YES')
	else:
		print('NO')

Buggy submission (verdict: Runtime Error):
X = int(input())
	if X in [7, 5, 3]:
    	print('YES')
	else:
		print('NO')
Problem p03238 (python)

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

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

if N == 1:
  print('Hello World')
elif N == 2:
  print(int(A + B))
Problem p03323 (python)

Fixed submission:
a, b = map(int, input().split())
if a <= 8 and b <= 8:
  print('Yay!')
else:
  print(':(')

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a <= 8 and b b <= 8:
  print('Yay!')
else:
  print(':(')
Problem p03359 (python)

Fixed submission:
a, b = map(int, input().split())
if a > b:
  print(a -1)
else:
  print(a)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a > b:
  print(a -1)
elif:
  print(a)
Problem p03059 (python)

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

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

for i in range(N):
    if V[i] <= C[i]:
        continue
    Max = Max + V[i] - C[i]
print(Max)
Problem p03060 (python)

Fixed submission:
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
Max = 0

#先頭
for i in range(N):
    if V[i] <= C[i]:
        continue
    X,Y = V[i],C[i]
    tmpMax = X - Y
    for j in range(i+1,N):
        if V[j] <= C[j]:
            continue
        if Max < (X + V[j]) - (Y + C[j]):
            X = X + V[j]
            Y = Y + C[j]
            tmpMax = X - Y
    if Max < tmpMax:
        Max = tmpMax
        
print(Max)

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

for i in range(N):
    if V[i] <= C[i]:
        continue
    Max = Max + V[i] - C[i]
print(Max)
Problem p03059 (python)

Fixed submission:
hoge = input()

a, b, t = [int(x) for x in hoge.split(' ')]

print(int(((t+0.5)//a)*b))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
A = int(input())
if A < 1:
    print('×')
else:
    B = int(input())
    if B < 0:
        print('×')
    else:    
        T = int(input())
        if T < 0 and T > 20:
            print('×')
        else:                    
            T+=0.5
            ans = (T // A) *B
            print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# AtCoder Beginner Contest 125
# C - GCD on Blackboard

# N-1個の全パターンの最大公約数の最大値でOK

# 最大公約数を計算
# ユークリッドの互除法を用いる
# def gcd(x, y):
#     # 大きい方をaに
#     a, b = (x,y) if x>y else (y,x)
#     if a == b:
#         return a
#     else:
#         return gcd(a-b,b)

# 再帰で書くと数字が大きいときに最大深さを超えてしまう！
def gcd(x, y):
    while x != y:
        x, y = (x-y,y) if x>y else (y-x,x)
    return x
        

# N個の整数に対する最大公約数の計算
def calc(n, an):
    if n == 2:
        return gcd(an[0], an[1])
    else:
        return gcd(an[0], calc(n-1, an[1:]))


n = int(input())
an = [int(x) for x in input().split(' ')]

if n == 2:
    print(max(an))
else:
    #N-1個の組み合わせに対する最大公約数で最大のものを選ぶ
    # N-1個の組み合わせ
    bn = [[an[j] for j in range(n) if i != j] for i in range(n)]
    gcds = [calc(n-1, ary) for ary in bn]
    print(max(gcds))

Buggy submission (verdict: Runtime Error):
# 最大公約数を計算
# ユークリッドの互除法を用いる
def gcd(x, y):
    # 大きい方をaに
    a, b = (x,y) if x>y else (y,x)
    if a == b:
        return a
    else:
        return gcd(a-b,b)

# N個の整数に対する最大公約数の計算
def calc(n, an):
    if n == 2:
        return gcd(an[0], an[1])
    else:
        return gcd(an[0], calc(n-1, an[1:]))


n = int(input())
an = [int(x) for x in input().split(' ')]

if n == 2:
    print(max(an))
else:
    #N-1個の組み合わせに対する最大公約数で最大のものを選ぶ
    # N-1個の組み合わせ
    bn = [[an[j] for j in range(n) if i != j] for i in range(n)]
    gcds = [calc(n-1, ary) for ary in bn]
    print(max(gcds))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# AtCoder Beginner Contest 125
# C - GCD on Blackboard

# N-1個の全パターンの最大公約数の最大値でOK

# 最大公約数を計算
# ユークリッドの互除法を用いる
def gcd(x, y):
    # 大きい方をaに
    a, b = (x,y) if x>y else (y,x)
    if a == b:
        return a
    else:
        return gcd(a-b,b)

# N個の整数に対する最大公約数の計算
def calc(n, an):
    if n == 2:
        return gcd(an[0], an[1])
    else:
        return gcd(an[0], calc(n-1, an[1:]))


n = int(input())
an = [int(x) for x in input().split(' ')]

if n == 2:
    print(max(an))
else:
    #N-1個の組み合わせに対する最大公約数で最大のものを選ぶ
    # N-1個の組み合わせ
    bn = [[j for j in an if i != j] for i in an]
    if len(bn) == 0:
        print(an[0])
    else:
        gcds = [calc(n-1, ary) for ary in bn]
        print(max(gcds))
Problem p03062 (python)

Fixed submission:

N = int(input())
A = [ int(v) for v in input().split() ]

if N < 2 and 1e5 < N: raise()
for v in A:
    if v < -1e9 and v < 1e9: raise()

abs_list = [abs(v) for v in A]

total = sum( abs_list )
num_of_minus = sum([ True for v in A if v < 0 ])

if num_of_minus % 2 == 1:
    print(total - min( abs_list ) * 2)
else:
    print(total)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N = int(input())
A = [int(v) for v in input().split(' ')]

# 負の数が偶数 -> 全部+にできる
# 負の数が奇数 -> どれか一つが-になる
# 負の数の偶奇チェック
sign = 1
for a in A:
    sign *= a/abs(a)

abs_A = [abs(a) for a in A]

if sign > 0:
    print(sum(abs_A))
else:
    print(sum(abs_A)-min(abs_A)*2)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N = int(input())
A = [int(v) for v in input().split(' ')]

# 負の数が偶数 -> 全部+にできる
# 負の数が奇数 -> どれか一つが-になる
# 負の数の偶奇チェック
sign = 1
for a in A:
    sign *= a/abs(a)

abs_A = [abs(a) for a in A]

if sign > 0:
    print(sum(abs_A))
else:
    print(sum(abs_A)-min(abs_A))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N = int(input())
A = [int(v) for v in input().split(' ')]

# 負の数が偶数 -> 全部+にできる
# 負の数が奇数 -> どれか一つが-になる
# 負の数の偶奇チェック
sign = 1
for a in A:
    sign *= a/abs(a)
    
if sign > 0:
    print(sum(A))
else:
    print(sum(A)-min(A))
Problem p03105 (python)

Fixed submission:
A,B,C=map(int,input().split())
d=B//A
if d<C:
  print(d)
else:
  print(C)

Buggy submission (verdict: Runtime Error):
A,B,C=map(int,input().split)
d=B//A
if d<C:
  print(d)
else:
  print(C)

Buggy submission (verdict: Runtime Error):
A,B,C=map(int,input().split())
d=B//A
if d<=C:
  print(d)
  else:
    print(C)

Buggy submission (verdict: Runtime Error):
A,B,C=map(int,input().split())
d=B//A
if d<C:
  print(d)
  else:
    print(C)
Problem p03109 (python)

Fixed submission:
S=input()
if S<='2019/04/30':
  print('Heisei')
else:
  print('TBD')

Buggy submission (verdict: Runtime Error):
S=input()
if S<=2019/4/30:
  print(Heisei)
else:
  print(TBD)
Problem p03071 (python)

Fixed submission:
A,B = input().split()
A= int(A)
B= int(B)
coin = 0
for i in range (2):
  if A>B:
    coin += A
    A-=1
  else:
    coin += B
    B-=1
    
print(coin)

Buggy submission (verdict: Runtime Error):
A,B = int(input().split())
coin = 0
for i in range (2):
  if A>B:
    coin+=A
  else:
    coin+=B
    
print(coin)
Problem p03059 (python)

Fixed submission:
a,b,t=map(int,input().split())
print(b*(t//a))

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
print(b*(t/a))
Problem p03407 (python)

Fixed submission:
a,b,c=map(int,input().split())
if a+b>=c:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,int().split())
if a+b>=c:
    print("Yes")
else:
    print("No")
Problem p03059 (python)

Fixed submission:
input = input().split()
A = int(input[0])
B = int(input[1])
T = int(input[2])


print((T//A)*B)

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

res = 0
for i in range(N):
    a = V[i] - C[i]
    if a > 0:
        res = res + a
    else:
        pass

print(res)
Problem p03059 (python)

Fixed submission:
src = raw_input()

sp = src.split(" ")

A = int(sp[0])
B = int(sp[1])
T = int(sp[2])
cnt = int(int(T + 0.5) / A )

out = B * cnt
print(out)

Buggy submission (verdict: Runtime Error):
src = raw_input()

sp = src.split(" ")

A = int(sp[0])
B = int(sp[1])
T = int(sp[2])
cnt = int(int(T + 0.5) / A )

out = B * cnt
print(out)
Problem p03060 (python)

Fixed submission:
N = raw_input()
V = raw_input()
C = raw_input()

Va = V.split(" ")
Ca = C.split(" ")

Va = map(lambda x: int(x), Va)
Ca = map(lambda x: int(x), Ca)


X = 0
Y = 0
for v, c in zip(Va, Ca):
  if v > c:
    X += v
    Y += c

print(X - Y)

Buggy submission (verdict: Runtime Error):
N = raw_input()
V = raw_input()
C = raw_input()

Va = V.split(" ")
Ca = C.split(" ")

Va = map(lambda x: int(x), Va)
Ca = map(lambda x: int(x), Ca)


X = 0
Y = 0
for v, c in zip(Va, Ca):
  if v > c:
    X += v
    Y += c

print(X - Y)
Problem p03061 (python)

Fixed submission:
def GCD(a, b):
    """ Euclidean algorithm"""
    if a < b: (a, b) = (b, a)
    if b == 0: return a
    m = a % b
    while m != 0:
        a = b
        b = m
        m = a % b
    return b

N = int(input())
A = [ int(v) for v in input().split() ]

if N < 2 and 1e5 < N: raise()
for v in A:
    if v < 1 and v < 1e9: raise()


l_list = []
l = 0
for i in range(0, N):
    l = GCD(l, A[i])
    l_list.append( l )

r_list = []
r = 0
for i in range(-1, -(N+1), -1):
    r = GCD(r, A[i])
    r_list.append( r )

n = []    
for i in range(0, N):
    if i-1 < 0:
        l = 0
    else:
        l = l_list[i-1]
    if N-i-2 < 0:
        r = 0
    else:
        r = r_list[N-i-2]
    n.append(GCD(l, r))
print(max(n))

Buggy submission (verdict: Runtime Error):
    """ Euclidean algorithm"""
    if a < b: (a, b) = (b, a)
    if b == 0: return a
    m = a % b
    while m != 0:
        a = b
        b = m
        m = a % b
    return b

N = int(input())
A = [ int(v) for v in input().split() ]

if N < 2 and 1e5 < N: raise()
for v in A:
    if v < 1 and v < 1e9: raise()

result = []
for skip in range(N):
    l = 0
    r = 0
    for v in range(0, skip):
        l = GCD(l, A[v])
    for v in range(N-1, skip, -1):
        r = GCD(r, A[v])
    result.append(GCD(l, r))

print(max(result))
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):
if int(a) * int(b) % 2 == 0:
  print("Even")
else:
  print("Odd")

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

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
if int(a) * int(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")

Buggy submission (verdict: Runtime Error):
a = input("aの値を入力")
b = input("bの値を入力")
if (a % 2 == 0 or b % 2 == 0):
  print("Even")
else:
  print("Odd")
Problem p03494 (python)

Fixed submission:
N = int(input())
a  = [int(i) for i in input().split()]
t = 0
while all(i % 2 == 0 for i in a):
  a = [i / 2 for i in a]
  t = t + 1
print(t)

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
a  = [int(i) for i in input().split()]
b = np.zeros_like(a)
t = 0
while [i % 2 for i in a] == b:
  a = [i / 2 for i in a]
  t = t + 1
print(t)
Problem p03347 (python)

Fixed submission:
#!python
# -*- coding: utf-8 -*-


def main():
    N = int(input())
    A = [int(input()) for i in range(N)]
    X = [0 for i in range(N)]
    A += [0]
    X += [0]

    count = 0

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

    for i in range(N - 1, -1, -1):
        if A[i - 1] + 1 < A[i]:
            print(-1)
            return

        X[i] = max(0, X[i + 1] - 1)
        if A[i] == X[i]:
            continue

        count += A[i]
        X[i] = A[i]

    print(count)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!python
# -*- coding: utf-8 -*-


def main():
    N = int(input())
    A = [int(input()) for i in range(N)]
    X = [0 for i in range(N)]

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

    count = 0

    for i in range(N - 1, -1, -1):
        X[i] = X[i + 1] - 1
        if A[i] == X[i]:
            continue

        count += A[i]
        X[i] = A[i]

    print(count)


if __name__ == '__main__':
    main()