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

Fixed submission:
def makerectangle(n , a):

    listmax = []
    a.sort(reverse=True)
    for i in range(n):
        if len(a) > i + 1 and a[i] == a[i + 1] and listmax.count(a[i]) == 0:
            if len(a) > i + 3 and a[i] == a[i + 3] and len(listmax) == 0:
                return a[i] * a[i]
            else:
                listmax.append(a[i])
        if len(listmax) > 1:
            return listmax[0] * listmax[1]
    return 0


def main():
    n = int(input())
    a = list(map(int,input().split()))
    print(makerectangle(n , a))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def makerectangle(n , a):

    listmax = []
    a.sort(reverse=True)
    for i in range(n):
        if a[i] == a[i + 1] and listmax.count(a[i]) == 0:
            if a[i] == a[i + 3] and len(listmax) == 0:
                return a[i] * a[i]
            else:
                listmax.append(a[i])
        if len(listmax) > 1:
            return listmax[0] * listmax[1]
    return 0


def main():
    n = int(input())
    a = list(map(int,input().split()))
    print(makerectangle(n , a))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def makerectangle(n , a):

    listmax = []
    a.sort(reverse=True)
    for i in range(n):
        if a.count(a[i]) > 1 and listmax.count(a[i]) == 0:
            if a.count(a[i]) > 3 len(listmax) == 0:
                return a[i] * 2
            else:
                listmax.append(a[i])
        if len(listmax) > 1:
            return listmax[0] * listmax[1]
    return 0



def main():
    n = int(input())
    a = list(map(int,input().split()))
    print(makerectangle(n , a))

if __name__ == '__main__':
    main()
Problem p03759 (python)

Fixed submission:
def ntukusi(a,b,c):
    return "YES" if (b - a) == (c - b) else "NO"

def main():
    a , b , c = map(int, input().split())
    print(ntukusi(a , b , c))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def ntukusi(a,b,c):
    ans = "YES" if b - a = c - b else "NO"
    return ans

def main():
    a , b , c = map(int, input().split())
    print(ntukusi(a , b , c))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def ntukusi(a,b,c):
    return "YES" if b - a = c - b else "NO"

def main():
    a , b , c = map(int, input().split())
    print(ntukusi(a , b , c))

if __name__ == '__main__':
    main()
Problem p03828 (python)

Fixed submission:
N = int(input())
count = [1]*(N+1)
ans = 1
mod = 10**9+7

for i in range(2,N+1):
    wari = i
    for w in range(2,i+1):
        while wari % w == 0:
            count[w] += 1
            wari /= w

for i in range(N+1):
    ans *= count[i]

print(ans % mod)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
ans = 0
mod = 10**9+7

kai = math.factorial(N)
i = 2

while kai == 0:
    if kai % i == 0:


#for i in range(1,kai+1):
#    if kai % i == 0:
#        ans += 1

print(ans % mod)
Problem p03846 (python)

Fixed submission:
N = int(input())
A = sorted(list(map(int,input().split())))
amari = 10**9 + 7
ans = []
han = 0

if N % 2 == 0:
    han = 1
else:
    han = 0
    A.insert(0,0)


ans = list(int(i) for i in range(han,N,2))
ans += ans
ans.sort()

if ans == A:
    print(2**(N//2) % amari)
else:
    print("0")

Buggy submission (verdict: Runtime Error):
import sys

N = int(input())
A = sorted(list(map(int,input().split())))
amari = 10**9 + 7

if N % 2 == 0:
    ans = list(int(i) for i in range(1,N,2)*2)

else:
    ans = list(int(i) for i in range(0,N,2)*2)
    A.insert(0,0)

if ans == A:
    print(2**(N//2) % amari)
else:
    print("0")
Problem p03852 (python)

Fixed submission:
c = input()
clist = ['a','e','i','o','u']

if clist.count(c) == 0:
    print("consonant")
else:
    print("vowel")

Buggy submission (verdict: Runtime Error):
c = input()
clist = ['a','e','i','o','u']

if clist.count(c) == 0:
    print(consonant)
else:
    print(vowel)
Problem p03863 (python)

Fixed submission:
def anordinarygame(s):

    ans = ""
    if s[0] == s[-1]:
        ans = "Second" if len(s) % 2 else "First"
    else:
        ans = "First" if len(s) % 2 else "Second"

    return ans

def main():
    s = list(str(input()))
    print(anordinarygame(s))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def anordinarygame(s):

    flag = True
    count = 0
    while flag:
        for i in range(len(s)):
            if len(s) != i and i != 0 and str(s[i-1]) != str(s[i+1]):
                count += 1
                s.pop(i)
                continue
            elif len(s) == i:
                return "Second" if count % 2 == 0 else "First"
        if len(s) < 3:
            return "Second" if count % 2 == 0 else "First"

def main():
    s = list(str(input()))
    print(anordinarygame(s))

if __name__ == '__main__':
    main()
Problem p04043 (python)

Fixed submission:
ans = 0
A = list(map(int, input().split()))

for x in A:
    ans += x

print("YES" if ans == 17 else "NO")

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())

print("YES" if A+B+C == 17 else "NO")
Problem p02761 (python)

Fixed submission:
n, m = map(int, input().split())
sc = []
for _ in range(m):
    s_, c_ = map(int, input().split())
    sc.append([s_-1, c_])
ans = [-1 for _ in range(n)]
for s, c in sc:
    if s == 0 and c == 0:
        if n != 1:
            print(-1)
            exit()
    if ans[s] is -1: ans[s] = c
    elif ans[s] is not None and ans[s] != c:
        print(-1)
        exit()
for i in range(n):
    if ans[i] == -1:
        if i == 0:
            if n == 1: ans[i] = 0
            else: ans[i] = 1
        else:
            ans[i] = 0
print("".join(map(str, ans)))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
dic = {i: [] for i in range(1, n + 1)}
for _ in range(m):
    s_, c_ = map(int, input().split())
    if dic[s_]:
        if dic[s_][0] != c_:
            print(-1)
            exit()
        else: continue
    dic[s_].append(c_)
res = ""
if dic[1][0] == 0:
    print(-1)
    exit()
for k in dic.keys():
    if dic[k]:
        res += str(dic[k][0])
    else:
        if k == 1:
            res += "1"
        else:
            res += "0"
print(res)
Problem p02797 (python)

Fixed submission:
n, k, s = map(int, input().split())
ans = [s for _ in range(k)]
for i in range(k, n):
        ans.append(s+1) if s < 1000000000 else ans.append(1)
print(*ans)

Buggy submission (verdict: Runtime Error):
n, k, s = map(int, input().split())
ans = [s for _ in range(n)]
for i in range(k, n):
        ans[i] = ans[i] + 1 if s < 1000000000 else ans[i] = 1
print(*ans)
Problem p02995 (python)

Fixed submission:
import fractions
def lcm(a,b):
  return a*b //fractions.gcd(a, b)

A, B,C,D = map(int, input().split())

b_num = B//C + B//D - B//lcm(C, D)
a_num = (A-1)//C + (A-1)//D - (A-1)//lcm(C, D)
print((B-(A-1))-(b_num-a_num))

Buggy submission (verdict: Runtime Error):
import math


def func(a, b, div):
    if (a/div).is_integer(): c_1 = int(a/div)
    else: c_1 = a // div + 1
    c_2 = b // div
    return int(c_2 - c_1 + 1)


a, b, c, d = (int(x) for x in input().split())
print(int((b - a + 1) - func(a, b, c) - func(a, b, d) + func(a, b, c*d//math.gcd(c, d))))

Buggy submission (verdict: Runtime Error):
import math
a, b, c, d = (int(x) for x in input().split())
def func(div):
    if (a/div).is_integer(): c_1 = int(a/div)
    else: c_1 = a // div + 1
    c_2 = b // div
    return int(c_2 - c_1 + 1)
print(int((b - a + 1) - func(c) - func(d) + func(c*d//math.gcd(c, d))))
Problem p03001 (python)

Fixed submission:
w, h, x, y = (int(i) for i in input().split())
s = (w * h) / 2
met = 1 if (x == w/2 and y == h/2) else 0
print(s, met)

Buggy submission (verdict: Runtime Error):
w, h, x, y = map(int, input().split())
m = 1 if x == w/2 and y == h/2 else m = 0
print(w*h/2, m)
Problem p03074 (python)

Fixed submission:
from itertools import accumulate
n, k = map(int, input().split())
s = [i for i in input()]
zero_one = [0]
if s[0] == "0":
    zero_one.append(0)
s_ = s[0]
cnt = 0
for i in range(n):
    if s_ == s[i]:
        cnt += 1
    else:
        zero_one.append(cnt)
        cnt = 1
        s_ = s[i]
zero_one.append(cnt)
if s[-1] == "0":
    zero_one.append(0)
ans = 0
l = len(zero_one)
zero_one = list(accumulate(zero_one))
for i in range(0, l, 2):
    ans = max(ans, zero_one[min(l-1, i+2*k+1)] - zero_one[i])
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())

t = [[0] * 10 for _ in range(10)]
for i in range(1, N + 1):
    s = str(i)
    t[int(s[0])][int(s[-1])] += 1

result = 0
for i in range(1, 10):
    for j in range(1, 10):
        result += t[i][j] * t[j][i]
print(result)
Problem p03087 (python)

Fixed submission:
n, q = (int(x) for x in input().split())
s = input()
s = [s[i] for i in range(n)]
lr = []
for i in range(q):
    lr.append([int(x) for x in input().split()])
ac = [0 for _ in range(n)]
i, c = 0, 0
for i in range(n-1):
    if s[i] == "A" and s[i+1] == "C":
        ac[i+1] = ac[i] + 1
    else:
        ac[i+1] = ac[i]
for p in lr:
    l, r = p[0] - 1, p[1] - 1
    print(int(ac[r] - ac[l]))

Buggy submission (verdict: Runtime Error):
n, q = (int(x) for x in input().split())
s = input()
s = [s[i] for i in range(n)]
lr = []
for i in range(q):
    lr.append([int(x) for x in input().split()])
ac = [0 for _ in range(n)]
i, c = 0, 0
while i < n:
    if s[i] == "A":
        ac[i] = c
        i += 1
        if s[i] == "C":
            c += 1
            ac[i] = c
        else: ac[i] = c
    else:
        ac[i] = c
        i += 1
print(ac)
for p in lr:
    l, r = p[0] - 1, p[1] - 1
    print(int(ac[r] - ac[l]))

Buggy submission (verdict: Runtime Error):
n, q = (int(x) for x in input().split())
s = input()
s = [s[i] for i in range(n)]
lr = []
for i in range(q):
    lr.append([int(x) for x in input().split()])
ac = [0 for _ in range(n)]
for i in range(n):
    if s[i] != "A": continue
    elif s[i+1] != "C": continue
    else:
        ac[i] = 1
        ac[i+1] = 1
for p in lr:
    l, r = p[0] - 1, p[1]
    a = sum(ac[l:r])
    if s[l] == "C": a -= 1
    if s[r-1] == "A": a -= 1
    print(int(a/2))
Problem p03089 (python)

Fixed submission:
n = int(input())
b = list(map(int, input().split()))
res = []
for _ in range(n):
    idx = 0
    for i in range(len(b)):
        if b[i] == i + 1:
            idx = i + 1
    if idx == 0:
        print(-1)
        exit()
    res.append(idx)
    b.pop(idx-1)
res = res[::-1]
for i in range(n): print(res[i])

Buggy submission (verdict: Runtime Error):
n = int(input())
b = [int(i) for i in input().split()]
ans = []
idx = n
if 1 not in b:
    print(-1)
    exit()
for i in reversed(range(n)):
    if b[i] != 1: continue
    else:
        b_ = b[i:idx]
        idx = i
        ma = max(b_)
        for j, bi in enumerate(b_):
            if bi == j + 1:
                for _ in range(b_.count(bi)):
                    ans.append(bi)
            elif bi < j + 1:
                break
            else:
                print(-1)
                exit()
for i in range(n): print(ans[i])
Problem p03106 (python)

Fixed submission:
a, b, k = (int(x) for x in input().split())
l = [i for i in range(1, min(a, b)+1) if a % i == 0 and b % i == 0]
print(l[-k])

Buggy submission (verdict: Runtime Error):
a, b, k = (int(x) for x in input().split())
for i in reversed(range(min(a, b))):
    if a % i == 0 and b % i == 0: k -= 1
    if k == 0:
        print(i)
        break

Buggy submission (verdict: Runtime Error):
a, b, k = (int(x) for x in input().split())
c = max(a, b)
l = [1]
for i in range(2, int(c/2)+1):
    if a % i == 0 and b % i == 0: l.append(i)
print(l[-k])

Buggy submission (verdict: Runtime Error):
a, b, k = (int(x) for x in input().split())
if a > b:
    c = b
    b = a
    a = c
l = [1]
for i in range(2, int(b/2)+1):
    if a % i == 0 and b % i == 0: l.append(i)
print(l[-k])
Problem p03243 (python)

Fixed submission:
n = int(input())
ans = 111
print([111*i for i in range(1, 10) if 111*i>=n][0])

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = 111
print([111*i for i in range(9) if 111*i>=n][0])
Problem p03262 (python)

Fixed submission:
import fractions
n, x = map(int, input().split())
idx = [abs(int(i) - x) for i in input().split()]
ans = idx[0]
if n == 1: pass
else:
    for i in range(1, n):
        ans = fractions.gcd(ans, idx[i])
print(ans)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
gcd = lambda l: reduce(math.gcd, l)
n, x = map(int, input().split())
c = [abs(x-int(i)) for i in input().split()]
print(gcd(c))
Problem p03282 (python)

Fixed submission:
s = input()
k = int(input())
if k == 1: print(s[0])
else:
    for i in range(k):
        if s[i] != "1":
            print(s[i])
            break
        else:
            if i == k - 1:
                print(s[i])
                break

Buggy submission (verdict: Runtime Error):
s = input()
_ = int(input())
print(s[1]) if s[0] == "1" else print(s[0])

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())
i = 0
while s[i] == "1":
    i += 1
print(s[i])
Problem p03294 (python)

Fixed submission:
import fractions
from functools import reduce
def b(x, y):
    return (x * y) // fractions.gcd(x, y)
_ = int(input())
a = [int(x) for x in input().split()]
m = reduce(b, a, 1) - 1
print(sum([m % a_i for a_i in a]))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
def b(x, y):
    return (x * y) // math.gcd(x, y)
_ = int(input())
a = [int(x) for x in input().split()]
m = reduce(b, a, 1) - 1
print(sum([m % a_i for a_i in a]))
Problem p03393 (python)

Fixed submission:
# coding: utf-8
# Your code here!
 
S=list(input())
 
 
S=list(map(lambda x : ord(x)-97,S))
 
alpha=[0]*26
for s in S:
    alpha[s]=1
 
if len(S)!=26:
    for i in range(26):
        if alpha[i] == 0:
            S.append(i)
            ans=S[:]
            ans=list(map(lambda x :chr(x+97), ans))
            print("".join(ans))
            exit()
else:
    for i in range(26)[::-1]:
        if alpha[S[i]:].count(0)>0:
            for j in range(S[i],26):
                if alpha[j]==0:
                    ans=S[:i]+[j]
                    ans=list(map(lambda x :chr(x+97), ans))
                    print("".join(ans))
                    exit()
        else:
            alpha[S[i]]=0
 
print(-1)

Buggy submission (verdict: Runtime Error):
s = input()
ans = list(s)
alpha = [chr(i) for i in range(97, 97+26)]
if len(s) == 26 and s == "".join(alpha): print(-1)
else:
    for i in range(len(s)):
        if alpha[i] == ans[i]:
            if i == len(s) - 1:
                ans.append(alpha[i+1])
            else: continue
        else:
            ans = alpha[:i]
            ans[-1] = alpha[i]
            break
    print("".join(ans))
Problem p03696 (python)

Fixed submission:
n = int(input())
s = str(input())
r = [i for i in range(n) if s[i] == "("]
l = [i for i in range(n) if s[i] == ")"]
if r == []: print(n*"(" + s)
elif l == []: print(s + n*")")
elif min(r) > max(l):
    print(len(l)*"(" + s + len(r)*")")
else:
    cnt = 0
    for i in reversed(range(len(r))):
        if r[i] < max(l):
            cnt += 1
            l.pop(-1)
        if l == []: break
    print((len(l)) * "(" + s + (len(r) - cnt) * ")")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = str(input())
r = [i for i in range(n) if s[i] == "("]
l = [i for i in range(n) if s[i] == ")"]
if r == []: print(n*"(" + s)
elif l == []: print(s + n*")")
elif min(r) > max(l):
    print(len(l)*"(" + s + len(r)*")")
else:
    cnt = 0
    for i in reversed(range(len(r))):
        if r[i] < max(l):
            cnt += 1
            l.pop(-1)
    print((len(l)) * "(" + s + (len(r) - cnt) * ")")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = str(input())
r = [i for i in range(n) if s[i] == "("]
l = [i for i in range(n) if s[i] == ")"]
if min(r) > max(l):
    print(len(l)*"(" + s + len(r)*")")
else:
    cnt = 0
    for i in range(len(r)):
        if r[i] < max(l):
            cnt += 1
            l.pop(-1)
    print((len(l)) * "(" + s + (len(r) - cnt) * ")")
Problem p03161 (python)

Fixed submission:
import numpy as np


def main():
    n, k = map(int, input().split())
    height = np.fromstring(input(), 'int32', sep=' ')
    height = np.append(height, [0] * (k - 1))

    dp = np.full((n + k - 1), 10 ** 9, dtype='int')
    dp[0] = 0

    for i in range(n - 1):
        default_val = dp[i + 1:i + 1 + k]
        new_val = dp[i] + np.abs(height[i + 1:i + 1 + k] - height[i])
        dp[i + 1:i + 1 + k] = np.minimum(default_val, new_val)
    print(dp[n - 1])


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import numba


@numba.jit
def main(n,k,h):
    dp = [float('inf')] * n
    dp[0] = 0
    for i in range(n):
        for j in range(1, min(k, n - i - 1) + 1):
            dp[i + j] = min(
                dp[i + j],
                dp[i] + abs(h[i] - h[i + j]) )
    print(dp[-1])


if __name__ == "__main__":
    n, k = map(int, input().split())
    h = list(map(int, input().split()))
    main(n,k,h)

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

    # dp = [float('inf')] * n
    dp = np.full(n, float('inf'))
    dp[0] = 0
    for i in range(n):
        for j in range(1, min(k, n - i - 1) + 1):
            dp[i + j] = min(
                dp[i + j],
                dp[i] + abs(h[i] - h[i + j]) )
    print(int(dp[-1]))


if __name__ == "__main__":
    main()
Problem p02783 (python)

Fixed submission:
H,A=map(int,input().split())
count=0
while H>0:
  H-=A
  count+=1
print(count)

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
print(max(a*b,c*d))

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
print(max(a*b,c*d))
Problem p02981 (python)

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

Buggy submission (verdict: Runtime Error):
n,d = map(int,input().split())
x = [list(map(int,input().split())) for _ in range(n)]
ans = 0
for i in range(n):
	for j in range(i):
		ans += (sum((a-b)**2 for a,b in zip(x[i],x[j]))**0.5).is_integer()
print(ans)
Problem p02982 (python)

Fixed submission:
n,d = map(int,input().split())
x = [list(map(int,input().split())) for _ in range(n)]
ans = 0
for i in range(n):
	for j in range(i):
		ans += (sum((a-b)**2 for a,b in zip(x[i],x[j]))**0.5).is_integer()
print(ans)

Buggy submission (verdict: Runtime Error):
n,d=map(int,input().split())
x=[list(map(int,input().split()))for _ in range(n)]
ans=0
for i in range(n):
    for j in range(i):
        ans+=(sum((a-b)**2 for a,b in zip(x[i],x[j])**0.5)).is_integer()
print(ans)
Problem p03000 (python)

Fixed submission:
N,X=map(int,input().split())
L=list(map(int,input().split()))
total=0
count=1
for i in range(N):
    total+=L[i]
    if total<=X:
        count+=1
print(count)

Buggy submission (verdict: Runtime Error):
N,X=map(int,input().split())
L=list(map(int,input().split()))
total=0
count=0
for i in range(N+1):
    if total<=X:
        total+=L[i]
        count+=1
print(count)

Buggy submission (verdict: Runtime Error):
N,X=map(int,input().split())
L=list(map(int,input().split()))
total=0
count=0
for i in range(N+1):
    if total<=X:
        total+=L[i]
        count+=1
    else:
        break
print(count)

Buggy submission (verdict: Runtime Error):
N,X=map(int,input().split())
L=list(map(int,input().split()))
total=0
count=0
i=0
while total<=X:
    if i<=len(L):
        total+=L[i]
        i+=1
        count+=1
    else:
        break
print(count)

Buggy submission (verdict: Runtime Error):
N,X=map(int,input().split())
L=list(map(int,input().split()))
total=0
count=0
i=0
while total<=X:
    total+=L[i]
    i+=1
    count+=1
print(count)
Problem p03385 (python)

Fixed submission:
S=str(input())
if 'a' in S and 'b' in S and 'c' in S:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
r1=[i for i in range(a,min(b+1,a+k))]
r2=[i for i in range(max(a,b-k+1),b+1)]
r1.extend(r2)
result=set(r1)
for i in sorted(result):
    print(i)
Problem p03477 (python)

Fixed submission:
a,b,c,d=map(int,input().split())
if (a+b)>(c+d):
    print('Left')
elif (a+b)==(c+d):
    print('Balanced')
else:
    print('Right')

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split)
if (a+b)>(c+d):
    print('Left')
elif (a+b)==(c+d):
    print('Balanced')
else:
    print('Right')
Problem p03624 (python)

Fixed submission:
S=input()
alpha=set([i for i in "abcdefghijklmnopqrstuvwxyz"])
ans=alpha-set(list(S))
ans=sorted(ans)
print(ans[0] if len(ans)>0 else 'None')

Buggy submission (verdict: Runtime Error):
S=set(input())
alpha='abcdefghijklmnopqrstuvwxyz'
ans=sorted(set(alpha)^S)
print('None' if ans=='' else ans[0])
Problem p03632 (python)

Fixed submission:
a,b,c,d=map(int,input().split())
print(max(0,min(b,d)-max(a,c)))

Buggy submission (verdict: Runtime Error):
,b,c,d=map(int,input().split())
print(max(0,min(b,d)-max(a,c)))
Problem p03962 (python)

Fixed submission:
a,b,c=map(int,input().split())
if a==b==c:
    print(1)
elif a==b or b==c or c==a:
    print(2)
else:
    print(3)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
count=3
if a==b:
    count=count-1
if b==c:
    count=count-1
if c==a:
    count=count-1
print(count)
Problem p02658 (python)

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

n = int(input())
a_li = list(map(int, (input().split())))

product = 1

if 0 in a_li:
    product = 0
else:
    for i in a_li:
        product *= i
        if product > 10**18:
            print(-1)
            exit()

print(product)

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

n = int(input())
a_li = list(map(int, (input().split())))

product = 1

if 0 in a_li:
    product = 0
else:
    for i in a_li:
        product *= i
        if product > 10**18:
            product = -1
            break
    break
            
print(product)

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

from decimal import decimal

a, b = input().split()

print(int(decimal(a)*decimal(b)))
Problem p02681 (python)

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

S = input()
T = input()
l = len(S)

for i in range(0,l):
    if S[i] == T[i]:
        i = i + 1
        if i == l:
            print('Yes')
            break
    else:
        print('No')
        break

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

S = input()
T = input()
length = len[S] - 1

for i in range(length):
    if S[i] == T[i]:
        i = i + 1
        if i == len[T]:
            print('Yes')
            break
        break
    else:
        print('No')
        break

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

S = input()
T = input()

if S in T == True:
    if T[len(T)-1] == S[len(S)-1]
    print('Yes')
else:
    print('No')
Problem p02909 (python)

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

S = input()

if S == "Sunny":
    print("Cloudy")
elif S == "Cloudy":
    print("Rainy")
else:
    print("Sunny")

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

n, k, q = map(int, input().split())
a_li = [int(input()) for i in range(q)]

pt_li = [] #所持点数のリストを作る
for i in range(n):
    pt_li.append(k)

for t in range(q):
    for u in range(n):
        pt_li[u] -= 1
    pt_li[a_li[t]-1] += 1

print(pt_li)

for s in range(n):
     if pt_li[s] <= 0:
         print("No")
     else:
         print("Yes")

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

n, k, q = map(int, input().split())
a_li = [int(input()) for i in range(q)]

pt_li = [] 
for i in range(n):
    pt_li.append(k)

for t in range(q):
    for u in range(n):
        pt_li[u] -= 1
    pt_li[a_li[t]-1] += 1

for s in range(n):
     if pt_li[s] <= 0:
         print("No")
     else:
         print("Yes")
Problem p03060 (python)

Fixed submission:
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
x, y = 0, 0
for i in range(n):
  if v[i] > c[i]:
    x += v[i]
    y += c[i]
print(x-y)

Buggy submission (verdict: Runtime Error):
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
count = 0
for i in range(n):
  if v[i] > c[i]:
    x += v[i]
    y += c[i]
print(x-y)