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

Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))
print(len([i for i in h if i>=k]))

Buggy submission (verdict: Runtime Error):
import numpy as np
n, k = map(int, input().split())
h = np.array(list(map(int, input().split())))

print(np.sum(h>=k))
Problem p02911 (python)

Fixed submission:
n,k,q = map(int, input().split())
a = [int(input()) for _ in range(q)]
point_list  = [k-q] * n 
for i in a:
    point_list[i-1] += 1
for i in point_list:
    if i >0:
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
import numpy as np
n,k,q = map(int, input().split())
a = [input() for _ in range(q)]
point_list  = np.array([k] * n)

for i in a:
    print(point_list)
    point_list -= 1
    point_list[i-1] += 1

for i in point_list:
    if i >0:
        print('Yes')
    else:
        print('No')
Problem p02917 (python)

Fixed submission:
n = int(input())
b = list(map(int, input().split()))
a = [b[0], b[n-2]]
for i in range(n-2):
    a.append(min(b[i:i+2]))
print(sum(a))

Buggy submission (verdict: Runtime Error):
n = int(input())
b = list(map(int, input().split()))
a = [b[0], b[n-1]]
for i in range(n-2):
    a.append(min(b[i:i+2]))
print(sum(a))
Problem p02953 (python)

Fixed submission:
n = int(input())
h = list(map(int, input().split()))
if n==1:
    print('Yes')
    exit()
ht = h[-1]
for i in reversed(range(n-1)):
    if ht == h[i]-1:
        h[i]-=1
    elif ht < h[i]-1:
        print('No')
        exit()
    ht = h[i]
print('Yes')

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
if n==1:
    print('Yes')
    exit()
for i in range(n-2):
    if h[n-i-1] == (h[n-i-2]-1):
        h[n-i-1] -= 1
    elif h[n-i] < (h[n-i-1]-1):
        print('No')
        exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
if n==1:
    print('Yes')
    exit()
for i in range(n-2):
    print(n)
    print(i)
    if h[n-i-1] == (h[n-i-2]-1):
        h[n-i-1] -= 1
    elif h[n-i] < (h[n-i-1]-1):
        print('No')
        exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
if n==1:
    print('Yes')
    exit()
for i in range(n-1):
    if h[n-i] == (h[n-i-1]-1):
        h[n-i-1] -= 1
    elif h[n-i] < (h[n-i-1]-1):
        print('No')
        exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
if n==1:
    print('Yes')
    exit()
for i in range(n-1):
    if h[n-i] = (h[n-i-1]-1):
        h[n-i-1] -= 1
    elif h[n-i] < (h[n-i-1]-1):
        print('No')
        exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
if n==1:
    print('Yes')
    exit()
for i in range(n-1):
    if h[n-i] = h[n-i-1]-1:
        h[n-i-1] -= 1
    elif h[n-i] < h[n-i-1]-1:
        print('No')
        exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
if n==1:
    print('Yes')
    exit()
for i in range(n-1):
    if n[n-i] = n[n-i-1]-1:
        n[n-i-1] -= 1
    elif n[n-i] < n[n-i-1]-1:
        print('No')
        exit()
print('Yes')
Problem p02996 (python)

Fixed submission:
n = int(input())
ba_list = []
for i in range(n):
    ba_tmp = list(map(int, input().split()))
    ba_list.append(ba_tmp[::-1])
ba_list.sort()
now_time = 0
for i in range(n):
    now_time += ba_list[i][1]
    if now_time > ba_list[i][0]:
        print('No')
        exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
n = int(input())
ba_list = []
for i in range(n):
    ba_tmp = list(map(int, input().split()))
    ba_list.append([ba_tmp[1], [ba_tmp[0]])
ba_list.sort()
now_time = 0
for i in range(n):
    now_time += ba_list[i][1]
    if now_time > ba_list[i][0]:
        print('No')
        exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
n = int(input())
b_list = []
for i in range(n):
    ba_tmp = list(map(int, input().split()))
    ba_list.append([ba_tmp[1], ba_tmp[0]])
ba_list.sort()
now_time = 0
for i in range(n):
    now_time += ba_list[i][1]
    if now_time > ba_list[i][0]:
        print('No')
        exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
n = int(input())
b_list = []
for i in range(n):
    ba_tmp = list(map(int, input().split()))
    ba_list.append([ba_tmp[1], [ba_tmp[0]])
ba_list.sort()
now_time = 0
for i in range(n):
    now_time += ba_list[i][1]
    if now_time > ba_list[i][0]:
        print('No')
        exit()
print('Yes')
Problem p03001 (python)

Fixed submission:
w,h,x,y = map(int, input().split())
ans_1 = w*h/2
ans_2 = 0
if (x==(w/2)) and (y == (h/2)):
    ans_2 = 1
print(" ".join(map(str, [ans_1,ans_2])))

Buggy submission (verdict: Runtime Error):
w,h,x,y = map(int, input().split())
ans_1 = w*h/2
ans_2 = 0
if (x==w/2) and (h == y/2):
    ans_2 = 1
print(" ".join([ans_1,ans_2]))

Buggy submission (verdict: Runtime Error):
w,h,x,y = map(int, input().split())
ans_1 = w*h/2
ans_2 = 0
if (x==w/2) and (h == y/2):
    ans_2 = 1
print("".join(map(str, ans_1,ans_2)))
Problem p02780 (python)

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

sum = 0
max = 0

for i in range(K):
    sum += array[i]
    max = sum

for i in range(K, N):
    sum += array[i] - array[i - K]
    if sum > max:
        max = sum

E = (max + K) / 2
print(E)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N, K = map(int, input().split())
array = list(map(int, input().split()))

sum = 0
max = 0
max_index = K

for i in range(K):
    sum += array[i]
    max = sum

for i in range(K, N):
    sum += array[i] - array[i - K]
    if sum > max:
        max = sum
        max_index = i

E = [(array[x] + 1) / 2 for x in range(max_index - K + 1, max_index + 1)]

sum2 = 0
for x in E:
    sum2 += x

print(sum2)
Problem p02783 (python)

Fixed submission:
H, A = [int(i) for i in input().split(' ')]
print(H // A + min(H % A, 1))

Buggy submission (verdict: Runtime Error):
H A = [int(i) for i in input().split(' ')]
print(H // A + 1)

Buggy submission (verdict: Runtime Error):
H A = input().split(' ')
print(H // A + 1)
Problem p03160 (python)

Fixed submission:
k=int(input())
a=list(map(int,input().split()))
if k==1:
    print(0)
else:
    dp = [0] * k
    dp[1] = abs(a[0]-a[1])
    for i in range(2,k):
        dp[i]=min(
            dp[i-1]+abs(a[i]-a[i-1]),
            dp[i-2]+abs(a[i]-a[i-2])
        )
    print(dp[-1])

Buggy submission (verdict: Runtime Error):
# url: https://atcoder.jp/contests/dp/tasks
from functools import lru_cache
k=int(input())
a=list(map(int,input().split()))

@lru_cache(maxsize=None)
def f(idx,cost):
    if idx==k-1:
        return cost
    return min([
       f(idx+i,cost+abs(a[idx]-a[idx+i])) for i in [1,2]
        if idx+i<=k-1
    ])
print(f(0,0))
Problem p02732 (python)

Fixed submission:
from collections import Counter

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

def main(N, lst_A):

    dct_cntA = Counter(lst_A)
    sum_comb = 0

    for cntA in dct_cntA.values():
        comb = (cntA * (cntA - 1)) // 2
        sum_comb += comb

    for A in lst_A:
        print(sum_comb - (dct_cntA[A] - 1))

    return 0

if __name__ == "__main__":

    main(N, lst_A)

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {

    int N; cin >> N;
    vector<int> A(N);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }

    vector<int> uniqueA = A;
    sort(uniqueA.begin(), uniqueA.end());
    uniqueA.erase(unique(uniqueA.begin(), uniqueA.end()), uniqueA.end());

    int sum_comb_all = 0;
    for (int i = 0; i < uniqueA.size(); i++) {
        int num_A = count(A.begin(), A.end(), uniqueA[i]);
        int comb  = (num_A * (num_A-1)) / 2;
        sum_comb_all += comb;
    }


    for (int i = 0; i < N; i++) {

        int num_A     = count(A.begin(), A.end(), A[i]);
        int prev_comb = (num_A * (num_A-1)) / 2;
        int new_comb  = ((num_A-1) * (num_A-2)) / 2;

        int sum_comb  = sum_comb_all - prev_comb + new_comb;
        cout << sum_comb << endl;

    }

}
Problem p02761 (python)

Fixed submission:
[N, M] = list(map(int, input().split()))
lst_sc = [list(map(int, input().split())) for i in range(M)]

def main(N, M, lst_sc):
    
    numbers = [''] * N
    for sc in lst_sc:

        [s, c] = sc

        if s > N: return -1

        if numbers[s-1] == '':
            numbers[s-1] = str(c)
        elif not numbers[s-1] == str(c):
            return -1
            
    if N > 1 and numbers[0] == '0': return -1
    if N == 1 and numbers[0] == '': return 0
    
    answer = ''
    for i in range(N):
        if numbers[i] == '':
            if i == 0: numbers[i] = '1'
            else     : numbers[i] = '0'
        answer += numbers[i]
    return int(answer)
    

if __name__ == "__main__":

    answer = main(N, M, lst_sc)
    print(answer)

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

def main(N, M, lst_sc):
    
    numbers = [''] * N
    for sc in lst_sc:

        [s, c] = sc

        if s > N: return -1

        if numbers[s-1] == '':
            numbers[s-1] = str(c)
        elif numbers[s-1] == str(c):
            pass
        else:
            return -1

    if N > 1 and numbers[0] == '0': return -1
    if numbers[1] == '': numbers[1] = '0'
    if numbers[2] == '': numbers[2] = '0'
    
    answer = ''
    for i in range(N):
        answer += numbers[i]
    return int(answer)
    

if __name__ == "__main__":

    answer = main(N, M, lst_sc)
    print(answer)
Problem p03485 (python)

Fixed submission:
a,b=map(int,input().split(" "))
print((a+b+1)//2)

Buggy submission (verdict: Runtime Error):
i=lambda:int(input())
print((i()+i()+1)//2)
Problem p03635 (python)

Fixed submission:
n,m=map(int,input().split())
print((n-1)*(m-1))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
print((n-1)(m-1))
Problem p03773 (python)

Fixed submission:
a,b=map(int,input().split())
print((a+b)%24)

Buggy submission (verdict: Runtime Error):
print((int(input())+int(input()))%24)
Problem p02898 (python)

Fixed submission:
n,k = map(int, input().split())
arr = list(map(int, input().split()))
ans = 0
for i in arr:
  if i >= k:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n,k = maP(int, input().split())
arr = list(map(int, input().split()))
ans = 0
for i in arr:
  if i >= k:
    ans += 1
print(ans)
Problem p02899 (python)

Fixed submission:
n = int(input())
arr = [0 for i in range(n)]
cnt = list(map(int, input().split()))
for i in range(n):
  arr[cnt[i]-1] = i+1
print(*arr)

Buggy submission (verdict: Runtime Error):
n = int(input())
arr = [0 for i in range(n)]
cnt = list(map(int, input().split()))
for i in range(n):
  arr[cnt[i]] = i+1
print(*arr)
Problem p02971 (python)

Fixed submission:
n = int(input())
arr = []
for i in range(n):
    arr.append(int(input()))
rev = sorted(arr, reverse = True)
for i in range(n):
    if arr[i] == rev[0]:
        print(rev[1])
    else:
        print(rev[0])

Buggy submission (verdict: Runtime Error):
n = int(input())
arr = list(map(int, input().split()))
rev = sorted(arr, reverse = True)
for i in range(n):
  if arr[i] == rev[-1]:
    print(rev[-2])
  else:
	print(rev[-1])
Problem p03160 (python)

Fixed submission:
n = int(input())
arr = list(map(int, input().split()))
cnt = [[0,0] for x in range(n-1)]
for i in range(1,n):
	if i == 1:
		cnt[i-1][0] = abs(arr[i-1]-arr[i])
		cnt[i-1][1] = 100000
	else:
		cnt[i-1][0] = abs(arr[i-1]-arr[i])
		cnt[i-1][1] = abs(arr[i-2]-arr[i])
for i in range(1,n-1):
	cnt[i][0] += min(cnt[i-1])
	if i != 1:
		cnt[i][1] += min(cnt[i-2])
print(min(cnt[-1]))

Buggy submission (verdict: Runtime Error):
from math import inf
n = int(input())
arr = list(map(int, input().split()))
cnt = [[0,0] for x in range(n-1)]
for i in range(1,n):
    if i == 1:
        cnt[i-1][0] = abs(arr[i-1]-arr[i])
        cnt[i-1][1] = inf
    else:
        cnt[i-1][0] = abs(arr[i-1]-arr[i])
        cnt[i-1][1] = abs(arr[i-2]-arr[i])
for i in range(1,n-1):
    cnt[i][0] += min(cnt[i-1])
    if i != 1:
        cnt[i][1] += min(cnt[i-2])
print(min(cnt[-1]))

Buggy submission (verdict: Runtime Error):
from math import inf
n = int(input())
arr = list(map(int, input().split()))
cnt = [[0,0] for x in range(n-1)]
for i in range(1,n):
    if i == 1:
        cnt[i-1][0] = abs(arr[i-1]-arr[i])
        cnt[i-1][1] = inf
    else:
        cnt[i-1][0] = abs(arr[i-1]-arr[i])
        cnt[i-1][1] = abs(arr[i-2]-arr[i])
for i in range(1,n-1):
    cnt[i][0] += min(cnt[i-1])
    if i != 1:
        cnt[i][1] += min(cnt[i-2])
print(min(cnt[-1]))
Problem p02743 (python)

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

if c - a - b > 0:
    if 4 * a * b < (c - a - b) ** 2:
        print("Yes")
    else:
        print("No")
else:
    print("No")

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

if c - a - b > 0:
    if 4 * a * b < (c - a - b) ** 2:
        print("Yes")
    else:
        print("No")
else:
    print("No")
Problem p02755 (python)

Fixed submission:
import sys
input = sys.stdin.readline
A, B = map(int, input().split())

xmin = 1
while xmin :
    if int(0.08*xmin) == A and int(0.1*xmin) == B :
        print(int(xmin))
        exit()
    elif int(0.08*xmin) < A or int(0.1*xmin) < B :
        xmin += 1
    else :
        print(-1)
        exit()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
A, B = map(int, input().split())

xmin = 1
while :
    if int(0.08*xmin) == A and int(0.1*xmin) == B :
        print(int(xmin))
        exit()
    elif int(0.08*xmin) < A or int(0.1*xmin) < B :
        xmin += 1
    else :
        print(-1)
        exit()
Problem p02791 (python)

Fixed submission:
N = int(input())
list_P = [int(x) for x in input().split()]

ans = 0
min = N+1

for i in list_P :
    if i < min :
        ans += 1
        min = i

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
list_P = [int(x) for x in input().split()]

ans = 1

for i in range(1, len(list_P)) :
    if list_P[i] == min(list_P[:i]+1) :
        ans += 1

print(ans)
Problem p02814 (python)

Fixed submission:
N, M = map(int, input().split())
list_a = [int(x) for x in input().split()]

import fractions

def insu2(a) :
    insu = 0
    while a%2 == 0 :
        insu += 1
        a /= 2
    return insu

check = True

for i in list_a :
    if insu2(i) != insu2(list_a[0]) :
        print(0)
        exit()

ans_0 = list_a[0]
for i in range(1,N) :
    ans_0 = ans_0 * list_a[i] // fractions.gcd(ans_0, list_a[i])

ans_0 //= 2
ans = M//ans_0 - M//(ans_0*2)

print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
list_a = [int(x) for x in input().split()]

import fractions

def insu2(a) :
    insu = 0
    while a%2 == 0 :
        insu += 1
        a /= 2
    return insu

check = True

for i in list_a :
    if insu2(i) != insu2(list_a[0]) :
        check = False

ans_0 = list_a[0]
for i in range(1,N) :
    ans_0 = ans_0 * list_a[i] // fractions.gcd(ans_0, list_a[i])

if ans_0 == 2 :
    ans = int(M+1/2)
else :
    ans = int((int(M/(ans_0/2))+1)/2)

if check == False :
    print(0)
else :
    print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
list_a = [int(x) for x in input().split()]

import fractions

def insu2(a) :
    insu = 0
    while a%2 == 0 :
        insu += 1
        a /= 2
    return insu

check = True

for i in list_a :
    if insu2(i) != insu2(list_a[0]) :
        check = False

ans_0 = list_a[0]
for i in range(1,N) :
    ans_0 = ans_0 * list_a[i] // fractions.gcd(ans_0, list_a[i])

ans = int((int(M/(ans_0/2))+1)/2)

if check == False :
    print(0)
else :
    print(ans)
Problem p03254 (python)

Fixed submission:
N, x = map(int, input().split())
list_a = [int(x) for x in input().split()]

list_a.sort()
total = sum(list_a)
if x < list_a[0] :
    print(0)
    exit()
if x > total :
    print(len(list_a)-1)
    exit()
ans = 0

for i in range(N) :
    if list_a[i] <= x :
        x -= list_a[i]
        ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
N, x = map(int, input().split())
list_a = [int(x) for x in input().split()]

list_a.sort()
total = sum(list_a)
if x < list_a[0] :
    print(0)
    exit()
if x > total :
    print(ans-1)
    exit()
ans = 0

for i in range(N) :
    if list_a[i] <= x :
        x -= list_a[i]
        ans += 1

print(ans)
Problem p03597 (python)

Fixed submission:
# 入力 : 数字2つ
N = int(input())
A = int(input())

# 出力　N^2-A
ans = N * N - A
print(ans)

Buggy submission (verdict: Runtime Error):
# 入力 : 数字2つ
N, A = map(int, input().split())

# 出力　N^2-A
ans = N * N - A
print(ans)

Buggy submission (verdict: Runtime Error):
# 入力 : 数字2つ
N, A = map(int, input().split())

# 出力　N^2-A
print(N*N-A)
Problem p03612 (python)

Fixed submission:
N = int(input())
p = [int(x) for x in input().split()]

ans = 0
for i in range(N) :
    if p[i] == i+1 :
        if i == N-1 :
            p[i], p[i-1] = p[i-1], p[i]
            ans += 1
        else :
            p[i], p[i+1] = p[i+1], p[i]
            ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
p = [int(x) for x in input().split()]

ans = 0
for i in range(N) :
    if p[i] == i+1 :
        p[i], p[i+1] = p[i+1], p[i]
        ans += 1

print(ans)
Problem p04013 (python)

Fixed submission:
N, A = map(int, input().split())
x = [int(i) for i in input().split()]

x.sort()
x = [i - A for i in x]
D = {0 : 1}
for i in x :
    for j, k in list(D.items()) :
        D[i+j] = D.get(i+j, 0) + k

print(D[0] - 1)

Buggy submission (verdict: Runtime Error):
N, A = map(int, input().split())
x = [0] + [int(i) for i in input().split()]

dp = [[[0]*(N*max(x)+1)]*(N+1) for _ in range(N+1)]
dp[0][0][0] = 1

for i in range(N+1):
    for j in range(N+1) :
        for k in range(N*max(x)+1) :
            if i >= 1 and k < x[i] :
                dp[i][j][k] = dp[i-1][j][k]
            if i >= 1 and j >= 1 and k >= x[i] :
                dp[i][j][k] = dp[i-1][j][k] + dp[i-1][j-1][k-x[i]]

ans = 0
for j in range(N+1) :
    ans += dp[N][j][j*A]
print(ans-1)
Problem p02817 (python)

Fixed submission:
S,T = input().split()
U = ""
U = U + T + S
print(U)

Buggy submission (verdict: Runtime Error):
S,T = map(input().split())
U = ""
U = U + T + S
print(U)

Buggy submission (verdict: Runtime Error):
S,T = map(input().split())
U = T + S
print(U)
Problem p03238 (python)

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

Buggy submission (verdict: Runtime Error):
#Partition
import math
N,M = map(int,input().split())
n = 1
rootM = int(math.sqrt(M))
for i in range(rootM+1):
    if M % (i+1) == 0 and N*(i+1) <= M:
        n = i+1
if N == 1:
    n = M
print(n)
Problem p03448 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
n = 0
for i in range(A+1):
  for j in range(B+1):
    for k in range(C+1):
      if 500*i + 100*j + 50*k == X:
        n += 1
print(n)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())
n = 0
for i in range(A+1):
  for j in range(B+1):
    for k in range(C+1):
      if 500*i + 100*j + 50*k = X:
        n += 1
print(n)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())
n = 0
for i in range(A):
  for j in range(B):
    for k in range(C):
      if 500*i + 100*j + 50*k = X:
        n += 1
print(n)
Problem p03563 (python)

Fixed submission:
#Rating Goal
R = int(input())
G = int(input())
T = R + 2 * (G - R)
print(T)

Buggy submission (verdict: Runtime Error):
#Rating Goal
R, G = map(int, input().split())
T = R + 2 * (G - R)
print(T)

Buggy submission (verdict: Runtime Error):
#Rating Goal
R, G = map(int, input().split())
T = R + 2 * (G - R)
print (T)
Problem p03567 (python)

Fixed submission:
#Can you get AC?
S = input()
n = len(S)
p = 0
for i in range(n-1):
    if S[i:i+2] == "AC":
        print("Yes")
        p = p + 1
        break
    else:
        continue
if p == 0:
    print("No")

Buggy submission (verdict: Runtime Error):
#Can you get AC?
S = input()
p = 0
for i in range(n-1):
    if S[i:i+2] == "AC":
        print("Yes")
        p = p + 1
        break
    else:
        continue
if p == 0:
    print("No")

Buggy submission (verdict: Runtime Error):
#Can you get AC?
S = input()
p = 0
for i in range(n-1):
    if S[i:i+2] == "AC":
        print("Yes")
        p = p + 1
        break
    else:
        continue
if p == 0:
    print("No")
Problem p03633 (python)

Fixed submission:
#Multiple Clocks
import fractions
N = int(input())
T = int(input())
for i in range (N-1):
    t = int(input())
    T = t*T // fractions.gcd(t,T)
print(T)

Buggy submission (verdict: Runtime Error):
#Multiple Clocks
import math
N = int(input())
T = int(input())
for i in range (N-1):
    t = int(input())
    T = t*T // math.gcd(t,T)
print(T)
Problem p03679 (python)

Fixed submission:
#Expired?
X, A, B = map(int, input().split())
Count = -A+B
if Count <= 0:
    print("delicious")
elif Count <= X:
    print("safe")
else:
    print("dangerous")

Buggy submission (verdict: Runtime Error):
#Expired?
X, A, B = map(int, input().split())
Count = -A+B
if Count <= 0:
    print("delicious")
elif Cunt <= X:
    print("safe")
else:
    print("dangerous")
Problem p03695 (python)

Fixed submission:
#Colorful Leaderboard
N = int(input())
a = list(map(int, input().split()))
L = [0 for i in range(8)]
s = 0
for i in range(N):
    if a[i] < 3200:
        L[a[i]//400] = L[a[i]//400] + 1
    else:
        s = s + 1
n = 0
for i in range(8):
    if L[i] > 0:
        n = n + 1
nmin = n
nmax = n + s
if nmin == 0:
    nmin = 1
print(str(nmin)+" "+str(nmax))

Buggy submission (verdict: Runtime Error):
#Colorful Leaderboard
N = int(input())
a = list(map(int, input().split()))
L = [0 for i in range(9)]
for i in range(N):
    L[a[i]//400] = L[a[i]//400] + 1
n = 0
for i in range(8):
    if L[i] > 0:
        n = n + 1
nmin = n
nmax = n + L[8]
if nmax > 9:
    nmax = 9
print(str(nmin)+" "+str(nmax))
Problem p03721 (python)

Fixed submission:
#Big Array
N, K = map(int, input().split())
a = [0]*(N)
b = [0]*(N)
R = [0]*(10**5+1)
ans = 0
for i in range(N):
    a[i], b[i] = map(int, input().split())
for i in range(N):
    R[a[i]] = R[a[i]] + b[i]
j = 0
while K > 0:
    K = K - R[j]
    ans = ans + 1
    j = j + 1
print(ans-1)

Buggy submission (verdict: Runtime Error):
#Big Array
N, K = map(int, input().split())
a = [0]*N
b = [0]*N
R = [0]*(10**5)
ans = 0
for i in range(N):
    a[i], b[i] = map(int, input().split())
for i in range(N):
    R[a[i]] = R[a[i]] + b[i]
j = 0
while K > 0:
    K = K - R[j]
    ans = ans + 1
    j = j + 1
print(ans-1)
Problem p03760 (python)

Fixed submission:
#∵∴∵
O = input()
E = input()
S = ""
for i in range(len(E)):
    S = S + O[i]
    S = S + E[i]
if len(E) < len(O):
    S = S + O[len(O)-1]
print(S)

Buggy submission (verdict: Runtime Error):
#∵∴∵
O = input()
E = input()
S = ""
for i in range(len(E)):
    S = S + O[i]
    S = S + E[i]
if len(E) < len(O):
    S = S + S[len(O)]
print(S)
Problem p03831 (python)

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

d = []
for i in range(n-1):
  d.append(x[i+1]-x[i])

f = 0
for i in range(n-1):
  if d[i]*a <= b:
    f += d[i]*a
  else:
    f += b
    
print(f)

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

d = []
for i in range(n-1):
  d.append(x[i+1]-x[i])

f = 0
for i in range(n-1):
  if d[i]*a <= b:
    f += d*a
  else:
    f += b
    
print(f)