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

Fixed submission:
input()
a=list(map(int,input().split(' ')))
sum=0
for i in a:
    sum+=i-1
print(sum)

Buggy submission (verdict: Runtime Error):
input()
a=input().split(' ')
sum=0
for i in a:
    sum+=i-1
print(sum)
Problem p03292 (python)

Fixed submission:
task = input().split(" ")
ans = 5000
if abs ( int(task [ 0 ]) - int(task [ 1 ])) + abs ( int(task [ 2 ]) - int(task [ 0 ])) < ans : 
	ans = abs ( int(task [ 0 ]) - int(task [ 1 ])) + abs ( int(task [ 2 ]) - int(task [ 0 ]))
if abs ( int(task [ 0 ]) - int(task [ 2 ])) + abs ( int(task [ 1 ]) - int(task [ 0 ])) < ans : 
	ans = abs ( int(task [ 0 ]) - int(task [ 2 ])) + abs ( int(task [ 1 ]) - int(task [ 0 ]))
if abs ( int(task [ 1 ]) - int(task [ 0 ])) + abs ( int(task [ 2 ]) - int(task [ 1 ])) < ans : 
	ans = abs ( int(task [ 1 ]) - int(task [ 0 ])) + abs ( int(task [ 2 ]) - int(task [ 1 ]))
if abs ( int(task [ 1 ]) - int(task [ 2 ])) + abs ( int(task [ 0 ]) - int(task [ 1 ])) < ans : 
	ans = abs ( int(task [ 1 ]) - int(task [ 2 ])) + abs ( int(task [ 0 ]) - int(task [ 1 ]))
if abs ( int(task [ 2 ]) - int(task [ 0 ])) + abs ( int(task [ 1 ]) - int(task [ 2 ])) < ans : 
	ans = abs ( int(task [ 2 ]) - int(task [ 0 ])) + abs ( int(task [ 1 ]) - int(task [ 2 ]))
if abs ( int(task [ 2 ]) - int(task [ 1 ])) + abs ( int(task [ 0 ]) - int(task [ 2 ])) < ans : 
	ans = abs ( int(task [ 2 ]) - int(task [ 1 ])) + abs ( int(task [ 0 ]) - int(task [ 2 ]))
print ( ans )

Buggy submission (verdict: Runtime Error):
task =  [int (i) for i in input.split(" ")]
ans=5000
if abs(task[0]-task[1])+abs(task[2]-task[0]) < ans:
	ans = abs(task[0]-task[1])+abs(task[2]-task[0])
if abs(task[0]-task[2])+abs(task[1]-task[0]) < ans:
	ans = abs(task[0]-task[2])+abs(task[1]-task[0])
if abs(task[1]-task[0])+abs(task[2]-task[1]) < ans:
	ans = abs(task[1]-task[0])+abs(task[2]-task[1])
if abs(task[1]-task[2])+abs(task[0]-task[1]) < ans:
	ans = abs(task[1]-task[2])+abs(task[0]-task[1])
if abs(task[2]-task[0])+abs(task[1]-task[2]) < ans:
	ans = abs(task[2]-task[0])+abs(task[1]-task[2])
if abs(task[2]-task[1])+abs(task[0]-task[2]) < ans:
	ans = abs(task[2]-task[1])+abs(task[0]-task[2])
print(ans)

Buggy submission (verdict: Runtime Error):
Source code
Copy
task =  [int (i) for i in input.split(" ")]
ans=5000
if abs(task[0]-task[1])+abs(task[2]-task[0]) < ans:
	ans = abs(task[0]-task[1])+abs(task[2]-task[0])
if abs(task[0]-task[2])+abs(task[1]-task[0]) < ans:
	ans = abs(task[0]-task[2])+abs(task[1]-task[0])
if abs(task[1]-task[0])+abs(task[2]-task[1]) < ans:
	ans = abs(task[1]-task[0])+abs(task[2]-task[1])
if abs(task[1]-task[2])+abs(task[0]-task[1]) < ans:
	ans = abs(task[1]-task[2])+abs(task[0]-task[1])
if abs(task[2]-task[0])+abs(task[1]-task[2]) < ans:
	ans = abs(task[2]-task[0])+abs(task[1]-task[2])
if abs(task[2]-task[1])+abs(task[0]-task[2]) < ans:
	ans = abs(task[2]-task[1])+abs(task[0]-task[2])
print(ans)
Problem p03292 (python)

Fixed submission:
a = list(map(int, input().split()))
a.sort()
sub = abs(a[0]-a[1])+abs(a[1]-a[2])
print(sub)

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

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm_list(numbers):
    a_0 = numbers.pop()
    for i in numbers:
        a_0 = lcm_base(a_0, i)
    return a_0

b = a.copy()
m = lcm_list(b)-1
sum = 0
for j in a:
    sum += m%j

print(sum)
Problem p03294 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
sum = 0
for a_i in a:
    sum += a_i-1
print(sum)

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

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm_list(numbers):
    a_0 = numbers.pop()
    for i in numbers:
        a_0 = lcm_base(a_0, i)
    return a_0

b = a.copy()
m = lcm_list(b)-1
sum = 0
for j in a:
    sum += m%j

print(sum)

Buggy submission (verdict: Runtime Error):
from functools import reduce
import math
n = int(input())
a = list(map(int, input().split()))

#最小公倍数−1
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

m = lcm_list(a)-1
sum = 0
for i in a:
    sum += m%i

print(sum)
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):
import copy
import numpy as np
n,m = map(int, input().split())
cakes = []
for i in range(n):
    cakes.append(list(map(int, input().split())))

def rec(i, k, s, obj):
    if i==k:
        obj.append(s)
        return
    rec(i+1, k, copy.deepcopy(s), obj)
    s[i]=1
    rec(i+1, k, copy.deepcopy(s), obj)
    s[i]=-1


def makeCombination(k):
    s=[-1 for i in range(k)]
    obj = []
    rec(0, k, s, obj)
    return obj

comb = makeCombination(3)
max = 0
for c in comb:
    sum_list = []
    nc = np.array(c)
    for cak in cakes:
        cake = np.array(cak)
        total = cake.dot(nc)
        sum_list.append(total)
    ssum_list = sorted(sum_list)
    sum_mm = sum(ssum_list[n-m:])
    if(max < sum_mm):
        max = sum_mm

print(max)
Problem p03331 (python)

Fixed submission:
n = int(input())
dp = [0 for i in range(n)]
min = float("inf")
for i in range(1, n//2):
    a_sum = sum(map(int, list(str(i))))
    b_sum = sum(map(int, list(str(n - i))))
    c = a_sum + b_sum
    if(min > c):
        min = c
if min == float("inf"):
    min = n
print(min)

Buggy submission (verdict: Runtime Error):
import math
n,a,b,k = map(int, input().split())
un = 998244353
def combination(n,r):
    return math.factorial(n)//(math.factorial(r) * math.factorial(n-r))

total = 0
for i in range(n+1):
    if((k-a*i)%b==0):
        count_b = (k-a*i)//b
        total += combination(n, i) * combination(n, count_b)

print(str(total % un))
Problem p03433 (python)

Fixed submission:
N = int(input())
A = int(input())
if(A>=N%500):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
c1 = list(map(int, input().split()))
c2 = list(map(int, input().split()))
c3 = list(map(int, input().split()))
total = 0
div = c1[0]+c2[1]+c3[2]
for (x,y,z) in zip(c1,c2,c3):
    total = total + x + y + z

print ('Yes' if total / div == 3 else 'No')
Problem p03435 (python)

Fixed submission:
c1 = list(map(int, input().split()))
c2 = list(map(int, input().split()))
c3 = list(map(int, input().split()))
total = 0
div = c1[0]+c2[1]+c3[2]
for (x,y,z) in zip(c1,c2,c3):
    total = total + x + y + z

print ('Yes' if total / 3 == div else 'No')

Buggy submission (verdict: Runtime Error):
c1 = list(map(int, input().split()))
c2 = list(map(int, input().split()))
c3 = list(map(int, input().split()))
total = 0
div = c1[0]+c2[1]+c3[2]
for (x,y,z) in zip(c1,c2,c3):
    total = total + x + y + z

print ('Yes' if total / div == 3 else 'No')
Problem p03302 (python)

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

if a + b == 15:
  print('+')
elif a * b == 15:
  print('*')
else:
  print('x')

Buggy submission (verdict: Runtime Error):
from heapq import *
import numpy as np

class vertex:
    def __init__(self):
        self.list_adj = []  # list of [no_adjnode, a, b]

    def add_edge(self, adj):
        self.list_adj.append(adj)

n, m, s, t = map(int, input().split())
# zero start
s -= 1
t -= 1

# 
vertices = []
for i in range(n):
    v = vertex()
    vertices.append(v)

print(n, m, s, t)
# load node
for k in range(m):
    u, v, a, b = map(int, input().split())
    vertices[u-1].add_edge([v-1, a, b])
    vertices[v-1].add_edge([u-1, a, b])


#print('-----------------')

#print(n, m, s, t)
#for i in range(n):
#    print(vertices[i].list_adj)

mode = 0
# return list of [no_adj, cost]
def get_adj(v):
    res = []
    for adj in v.list_adj:
        res.append([adj[0], adj[1+mode]])
    return res

#print('show adjcent(a)')
#for k in range(n):
#    print(get_adj(vertices[k]))

mode = 1
#print('show adjcent(b)')
#for k in range(n):
#    print(get_adj(vertices[k]))

def dijkstra(s):
    inf = int(10e20)
    dist = [inf] * n
    h = []
    heappush(h, (0, s))
    while len(h) > 0:
        # pop 1 node
        dv, v = heappop(h)
        # if already decided, continue
        if dist[v] < inf:
            continue
        dist[v] = dv
        # push adjcent node
        list_adj = get_adj(vertices[v])
        for adj in list_adj:
            if dist[adj[0]] == inf:
                heappush(h, (dv + adj[1], adj[0]))
                pass
        pass
    return dist

mode = 0
dist_a = dijkstra(s)
mode = 1
dist_b = dijkstra(t)
#cost = []
#for k in range(len(dist_a)):
#    cost.append(dist_a[k] + dist_b[k])
cost = np.array(dist_a,dtype = 'int') + np.array(dist_b,dtype = 'int')
cost = np.array(cost, dtype='int')
#print(cost)

m0 = int(10e15)
for i in range(n):
    cost_available = cost[i:]
    print(m0-np.amin(cost_available))
Problem p03292 (python)

Fixed submission:
arr = [int(i) for i in input().split()]
arr.sort()
arr.reverse()

result = (arr[0] - arr[1]) + (arr[1] - arr[2])
print(result)

Buggy submission (verdict: Runtime Error):
import numpy

s = list(input())
t = input()

tmp = s[:]
for i in range(len(tmp)):
    tmp = numpy.roll(tmp, 1)
    if ''.join(tmp) == t:
        print('Yes')
        exit()
print('No')
Problem p03292 (python)

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

A=N[0]
B=N[1]
C=N[2]

Answerlist= [0 for i in range(3)]
Answerlist[0]=abs(A-B)
Answerlist[1]=abs(B-C)
Answerlist[2]=abs(C-A)

print(max(Answerlist))

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

A=N[0]
B=N[1]
C=N[2]

Answerlist= [0 for i in range(3)]
Answerlist[0]=abs(A-B)
Answerlist[1]=abs(B-C)
Answerlist[2]=abs(C-A)

print(max(Answerlist))
Problem p03545 (python)

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

if a+b+c+d == 7:
    print(str(a) + "+" + str(b) + "+" + str(c) + "+" + str(d) + "=" + "7")
elif a+b+c-d == 7:
    print(str(a) + "+" + str(b) + "+" + str(c) + "-" + str(d) + "=" + "7")
elif a+b-c+d == 7:
    print(str(a) + "+" + str(b) + "-" + str(c) + "+" + str(d) + "=" + "7")
elif a+b-c-d == 7:
    print(str(a) + "+" + str(b) + "-" + str(c) + "-" + str(d) + "=" + "7")
elif a-b-c-d == 7:
    print(str(a) + "-" + str(b) + "-" + str(c) + "-" + str(d) + "=" + "7")
elif a-b-c+d == 7:
    print(str(a) + "-" + str(b) + "-" + str(c) + "+" + str(d) + "=" + "7")
elif a-b+c-d == 7:
    print(str(a) + "-" + str(b) + "+" + str(c) + "-" + str(d) + "=" + "7")
elif a-b+c+d == 7:
    print(str(a) + "-" + str(b) + "+" + str(c) + "+" + str(d) + "=" + "7")

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input())

if a+b+c+d == 7:
    print(a+"+"+b+"+"+c+"+"+d+"=7")
elif a+b+c-d == 7:
    print(a+"+"+b+"+"+c+"-"+d+"=7")
elif a+b-c-d == 7:
    print(a+"+"+b+"-"+c+"-"+d+"=7")
elif a-b-c-d == 7:
    print(a+"-"+b+"-"+c+"-"+d+"=7")
elif a-b+c-d == 7:
    print(a+"-"+b+"+"+c+"-"+d+"=7")
elif a-b-c+d == 7:
    print(a+"-"+b+"-"+c+"+"+d+"=7")
elif a-b+c-d == 7:
    print(a+"-"+b+"+"+c+"-"+d+"=7")

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input())

if a+b+c+d == 7:
    print(a+"+"+b+"+"+c+"+"+d+"=7")
elif a+b+c-d == 7:
    print(a+"+"+b+"+"+c+"-"+d+"=7")
elif a+b-c-d == 7:
    print(a+"+"+b+"-"+c+"-"+d+"=7")
elif a-b-c-d == 7:
    print(a+"-"+b+"-"+c+"-"+d+"=7")
elif a-b+c-d == 7:
    print(a+"-"+b+"+"+c+"-"+d+"=7")
elif a-b-c+d == 7:
    print(a+"-"+b+"-"+c+"+"+d+"=7")
Problem p03612 (python)

Fixed submission:
import sys
n = int (sys.stdin.readline())
a = map (int, sys.stdin.readline().split())
res = 0
for i in range (n):
  if a[i] == i+1:
    if i+1 < n:
      a[i], a[i+1] = a[i+1], a[i]
    res += 1
print (res)

Buggy submission (verdict: Runtime Error):
import sys
n = int (sys.stdin.readline())
a = map (int, sys.stdin.readline().split())
res = 0
for i in range (n):
  if a[i] == i+1:
    if i+1 < n:
      a[i], a[i+1] = a[i+1], a[i]
    res += 1
print (res)
Problem p03423 (python)

Fixed submission:
# -*- coding: utf-8 -*-
a = int(raw_input())
print (a/3)

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


def filter_name(n):
    return n.startswith("M") or n.startswith("A") or n.startswith("R") or n.startswith("C") or n.startswith("H")


def filter_ok(l):
    dic = {'M': 0, 'A': 0, 'R': 0, 'C': 0, 'H': 0}
    for i in l:
        dic[i[0:1]] += 1
    for num in dic.values():
        if num >= 2:
            return False
    return True


n = input()
a = []
for i in range(n):
    a.append(raw_input())

r = filter(filter_name, a)
c = list(itertools.combinations(r, 3))
r = filter(filter_ok, c)
print len(r)
Problem p03633 (python)

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

def lcm_base(x, y):
	return (x * y) // gcd(x, y)

def lcm_list(numbers):
    ans = lcm_base(numbers[0], numbers[1])
    for x in numbers:
        ans = lcm_base(ans, x)
    return ans

n = int(input())
t = [int(input()) for i in range(n)]

result = lcm_list(t) if len(t) != 1 else t[0]
print(result)

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

def lcm_base(x, y):
	return (x * y) // gcd(x, y)

def lcm_list(numbers):
    ans = lcm_base(numbers[0], numbers[1])
    for x in numbers:
        ans = lcm_base(ans, x)
    return ans

n = int(input())
t = [int(input()) for i in range(n)]

result = lcm_list(t)
print(result)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

n = int(input())
t = [int(input()) for i in range(n)]

result = lcm_list(t)
print(result)
Problem p03386 (python)

Fixed submission:
A, B, K = map(int, input().split())
setA = set([i for i in range(A,min(A+K,B+1))])
setB = set([i for i in range(max(A,B-K+1),B+1)])
setAB = sorted(setA | setB)
for i in list(setAB):
    print(i)

Buggy submission (verdict: Runtime Error):
setA = set([i for i in range(A,min(A+K,B+1))])
setB = set([i for i in range(max(A,B-K+1),B+1)])
setAB = sorted(setA | setB)
for i in list(setAB):
    print(i)
Problem p03433 (python)

Fixed submission:
n = int(input())
a = int(input())
if n % 500 <= a:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n = map(int, input().split())
a = map(int, input().split())
if n % 500 <= a:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n, a = map(int, input().split())
if n % 500 <= a:
    print('Yes')
else:
    print('No')
Problem p03543 (python)

Fixed submission:
a = list(map(int,list(input())))
if a[0] == a[1] & a[1] == a[2]:
    print('Yes')
elif a[1] == a[2] & a[2] == a[3]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a = list(map(int,list(input())))
if a[0] == a[1] & a[1] == a[2]:
    print('Yes')
elif a[1] == a[2] & a[3] == a[4]:
    print('Yes')
else:
    print('No')
Problem p03373 (python)

Fixed submission:
def should_buy_ab(a,b,c):
    return 2 * c <= a + b


def solve(a,b,c,x,y):
    paid = 0

    if should_buy_ab(a,b,c):
        common = min(x, y)
        paid += (common * 2 * c)
        x -= common
        y -= common

        if x > 0:
            return paid + x * min(a, 2 * c)
        else:
            assert y >= 0
            return paid + y * min(b, 2 * c)

    paid += x * a
    paid += y * b

    return paid


a, b, c, x, y = map(int, raw_input().split())
print solve(a,b,c,x,y)

Buggy submission (verdict: Runtime Error):
def should_buy_ab(a,b,c):
    return 2 * c <= a + b


def solve(a,b,c,x,y):
    paid = 0

    if should_buy_ab(a,b,c):
        common = min(x, y)
        paid += (common * 2 * c)
        x -= common
        y -= common

        if x > 0:
            return paid + x * min(a, 2 * c)
        else:
            assert y > 0
            return paid + y * min(b, 2 * c)

    paid += x * a
    paid += y * b

    return paid


a, b, c, x, y = map(int, raw_input().split())
print solve(a,b,c,x,y)
Problem p03294 (python)

Fixed submission:
def gcd(m,n):
    while n!=0:
        l=n
        n=m%n
        m=l
    return m

def lcm(p,q):
    return p*q//gcd(p,q)

N=int(input())
a=list(map(int,input().split(' ')))
lcm_=lcm(a[0],a[1])
for i in range(2,len(a)):
    lcm_=lcm(lcm_,a[i])
result=0
m=lcm_-1
for i in a:
    result+=m%i
print(result)

Buggy submission (verdict: Runtime Error):
from math import gcd
from functools import reduce
import sys

def lcm(p,q):
    return p*q//gcd(p,q)
sys.setrecursionlimit(3001)
N=int(input())
a=list(map(int,input().split(' ')))
m=reduce(lcm,a)-1
result=0
for i in a:
    result+=m%i
print(result)

Buggy submission (verdict: Runtime Error):
from math import gcd
from functools import reduce

def lcm(p,q):
    return p*q//gcd(p,q)

N=int(input())
a=list(map(int,input().split(' ')))
m=reduce(lcm,a)-1
result=0
for i in a:
    result+=m%i
print(result)
Problem p03309 (python)

Fixed submission:
import numpy as np
N=int(input())
A=np.array(list(map(int,input().split(' '))))
A=A-np.arange(N)
Amed=np.int(np.median(A))
err=[]
for b in (Amed,Amed+1):
    err.append(np.sum(np.abs(A-b)))
print(min(err))

Buggy submission (verdict: Runtime Error):
import numpy as np
N=int(input())
A=np.array(list(map(int,input().split(' '))))
A=A-np.arange(N)
Amed=np.int(A.median())
err=[]
for b in (Amed,Amed+1):
    err.append(np.sum(np.abs(A-b)))
print(min(err))

Buggy submission (verdict: Runtime Error):
import numpy as np
N=int(input())
A=np.array(list(map(int,input().split(' '))))
A=A-np.arange(N)
err=[]
for b in range(A.min(),A.max()):
    err.append(np.sum(np.abs(A-b)))
print(min(err))
Problem p03323 (python)

Fixed submission:
A,B=map(int, input().split(' '))
if A+B<=8:
    print('Yay!')
elif abs(A-B)<=(16-min([A,B])*2)/2:
    print('Yay!')
else:
    print(':(')

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
if A+B<=8:
    print('Yay!')
elif abs(A-B)<=(16-min([A,B])*2)/2:
    print('Yay!')
else:
    print(':(')

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
if A+B<=8:
    print('Yay!')
elif abs(A-B)<=(16-min([A,B]*2))/2:
    print('Yay!')
else:
    print(':(')
Problem p03302 (python)

Fixed submission:
a,b = map(int,input().split())
if a+b == 15 :
  print("+")
elif a*b == 15 :
  print("*")
else :
  print("x")

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

if a + b = 15 :
    print("+")
elif a*b = 15 :
    print("*")
else :
    print("×")
Problem p03308 (python)

Fixed submission:
n = int(input())
A = input().split()
for i in range(len(A)) :
    A[i] = int(A[i])
print(max(A)-min(A))

Buggy submission (verdict: Runtime Error):
A = []

N = int(input())*N

for i in range(0, N) :
    a = int(input())
    A.append(a)
    

print(max(A) - min(A))

Buggy submission (verdict: Runtime Error):
A = []

N = int(input())

for i in range(0, N) :
    a = int(input())
    A.append(a)
    

print(max(A) - min(A))

Buggy submission (verdict: Runtime Error):
A = []

N = int(input())
if N in range(1,100) :
    for i in range(1, N+1) :
        a = int(input())
        if a in range(1,int(10e8)) :
            A.append(a)
    
ma = max(A)
mi = min(A)

print(ma - mi)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = []
for i in range(1, N+1) :
    a = int(input())
    A.append(a)
print(A)

ma = max(A)
mi = min(A)

print(ma - mi)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = []
for i in range(1, N+1) :
    a = int(input())
    A.append(a)

ma = max(A)
mi = min(A)

print(ma - mi)
Problem p03501 (python)

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

Buggy submission (verdict: Runtime Error):
N,A,B = map(int,input().split())
print(min(A*T,B))
Problem p03294 (python)

Fixed submission:
def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)

def lcm(x,y):
	return (x * y) // gcd(x,y)

N = int(input())
a = list(map(int,input().split()))
a.sort()
tlcm = lcm(a[0],a[1])

for i in range(2,len(a)):
	tlcm = lcm(a[i],tlcm)

tlcm = tlcm - 1
result = 0
for i in range(len(a)):
	result += tlcm % a[i]
print(result)

Buggy submission (verdict: Runtime Error):
import math

def lcm(x,y):
	return (x * y) // math.gcd(x,y)

N = int(input())
a = list(map(int,input().split()))
a.sort()
tlcm = lcm(a[0],a[1])

for i in range(2,len(a)):
	tlcm = lcm(a[i],tlcm)

tlcm = tlcm - 1
result = 0
for i in range(len(a)):
	result += tlcm % a[i]
print(result)
Problem p03361 (python)

Fixed submission:
h, w = map(int, input().split())
data = ''
for i in range(h):
    data += input()

array = list(data)
#print(array)

for i, x in enumerate(array):
    if x == '.':
        continue
    cnt = 0
    # 上の確認
    if not i < w:
        if array[i - w] == '#':
            cnt += 1
    # 下の確認
    if i + w < h * w:
        if array[i + w] == '#':
            cnt += 1
    # 左の確認
    if i % w != 0:
        if array[i - 1] == '#':
            cnt += 1
    # 右の確認
    if i % w != w - 1:
        if array[i + 1] == '#':
            cnt += 1

    if cnt == 0:
        print('No')
        break
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
data = ''
for i in range(h):
    data += input()

array = list(data)

for i, x in enumerate(array):
    if x == '.':
        continue
    cnt = 0
    # 上の確認
    if not i < w:
        if array[i - w] == '#':
            cnt += 1
    # 下の確認
    if i + w < h * w:
        if array[i + w] == '#':
            cnt += 1
    # 左の確認
    if i % w != 0:
        if array[i - 1] == '#':
            cnt += 1
    # 右の確認
    if i + 1 % w != 0:
        if array[i + 1] == '#':
            cnt += 1

    if cnt == 0:
        print('No')
        break
else:
    print('Yes')
Problem p03369 (python)

Fixed submission:
s = input()
sum = 700
for a in s:
    if a == 'o':
        sum += 100
print(sum)

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
m = []
sum = 0
for i in range(n):
    a = int(input())
    m.append(a)
    sum += a
m = sorted(m)
#print(m)
x -= sum

#cnt = n
#while x >= m[0]:
#    cnt += 1
#    x -= m[0]
cnt = n + x // m[0]

print(cnt)
Problem p03370 (python)

Fixed submission:
n, x = map(int, input().split())
m = []
sum = 0
for i in range(n):
    a = int(input())
    m.append(a)
    sum += a
m = sorted(m)
#print(m)
x -= sum

cnt = n
while x >= m[0]:
    cnt += 1
    x -= m[0]

print(cnt)

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
m = []
sum = 0
for i in range(n):
    a = int(input())
    m.append(a)
    sum += a
m = sorted(m)
#print(m)
x -= sum

#cnt = n
#while x >= m[0]:
#    cnt += 1
#    x -= m[0]
cnt x // m[0]

print(cnt)
Problem p03399 (python)

Fixed submission:
a =int(input())
b =int(input())
c =int(input())
d =int(input())

sum = 0
if a > b:
    sum += b
else:
    sum += a

if c > d:
    sum += d
else:
    sum += c

print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
d, x = map(int, input().split())
#array = []
sum = x
for i in range(n):
    #array.append(int(input()))
    a = int(input())
#    sum += d // a
#    if d % a != 0:
#        sum += 1
    sum += (d - 1) // a + 1
print(sum)
#print(array)

#sum = x
#for a in array:
#    sum += d // a
#    if d % a != 0:
#        sum += 1
#print(sum)
Problem p03400 (python)

Fixed submission:
n = int(input())
d, x = map(int, input().split())
array = []
for i in range(n):
    array.append(int(input()))

sum = x
for a in array:
    j = 0
    while 1 + j * a <= d:
        sum += 1
        j += 1

print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
d, x = map(int, input().split())
#array = []
sum = x
for i in range(n):
    #array.append(int(input()))
    a = int(input())
#    sum += d // a
#    if d % a != 0:
#        sum += 1
    #sum += (d - 1) // a + 1
    sum += d // (a - 1) + 1
print(sum)