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

Fixed submission:
import numpy as np

N, K = map(int,input().split())
A = np.array(list(map(int,input().split())))
A.sort()
posi = A[A > 0]
zero = A[A == 0]
nega = A[A < 0]

# 積がx以下の組を求める
def check(x):
    count = 0  # 積がx以下の組
    if x >= 0:
        count += len(zero) * N  # zero * N
    count += np.searchsorted(A, x // posi, side = 'right').sum()  # posi * N
    count += (N - np.searchsorted(A, (-x - 1) // (-nega), side = 'right')).sum()  # nega * N
    count -= np.count_nonzero(A * A <= x)  # 自分自身との組
    return count // 2  #重複を消す

# 二分探索
low = -10 ** 18
high = 10 ** 18
while low + 1 < high:
    mid = (low + high) // 2
    if check(mid) < K:  # OK
        low = mid
    else:               # NG
        high = mid

print(high)

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

N, K = map(int,input().split())
A = np.array(list(map(int,input().split())))
A.sort()
posi = A[A > 0]
zero = A[A = 0]
nega = A[A < 0]

# x以下の数を求める
def check(x):
    count = 0  # 積がx以下の組
    if x >= 0:
        count += len(zero) * N  # zero * N
    count += np.searchsorted(A, x // posi, side = 'right').sum()  # posi * N
    count += np.searchsorted(A, (-x - 1) // nega, side = 'left').sum()  # nega * N
    count -= np.count_nonzero(A * A <= x)  # 自分自身との組
    return count // 2  #重複を消す

# 二分探索
low = -10 ** 18
high = 10 ** 18
while low + 1 < high:
    mid = (low + high) // 2
    if check(mid) >= K:
        low = mid
    else:
        high = mid

print(low)
Problem p02628 (python)

Fixed submission:
n, k = [int(i) for i in input().split()]
print(sum(sorted([int(i) for i in input().split()])[:k]))

Buggy submission (verdict: Runtime Error):
n, k = input().split()
print(sum(sorted([int(i) for i in input().split()])[:k]))

Buggy submission (verdict: Runtime Error):
n, k = input().split()
sum(sorted([int(i) for i in input().split()])[:k])

Buggy submission (verdict: Runtime Error):
n, k = input().split()
sum(input().split().sorted()[:k])
Problem p03166 (python)

Fixed submission:
from collections import defaultdict
debug = print
def debug(*va): pass

def longest_by_topological_sort(N, nexts, prevs):
    visited = [-1] * N
    max_dist = 0
    que = list(range(N))
    while len(que):
        p = que.pop()
        if visited[p] == -1:
            if all(visited[q] != -1 for q in prevs[p]):
                dist = 0
                for q in prevs[p]:
                    dist = max(dist, visited[q] + 1)
                visited[p] = dist
                max_dist = max(max_dist, dist)
                for n in nexts[p]:
                    que.append(n)
    return max_dist

def test_separate():
    import time
    N = 10**5
    t0 = time.time()
    print(longest_by_topological_sort(N, defaultdict(list), defaultdict(list)))
    print('elapsed', time.time() - t0)

def test_fanout():
    import time
    N = 10**5
    nn, pp = defaultdict(list), defaultdict(list)
    for i in range(1, N):
        nn[0].append(i)
        pp[i].append(0)
    t0 = time.time()
    print(longest_by_topological_sort(N, nn, pp))
    print('elapsed', time.time() - t0)

def test_middle():
    import time
    N = 10**5
    nn, pp = defaultdict(list), defaultdict(list)
    for i in range(1, N):
        # fanout
        nn[0].append(i)
        pp[i].append(0)
        # fanin
        nn[i].append(1)
        pp[1].append(i)
    t0 = time.time()
    print(longest_by_topological_sort(N, nn, pp))
    print('elapsed', time.time() - t0)

if __name__ == '__main__':
    N, M = map(int, input().split())

    nextnodes = [defaultdict(list), defaultdict(list)]
    for i in range(M):
        x, y = map(int, input().split())
        nextnodes[0][x - 1].append(y - 1)
        nextnodes[1][y - 1].append(x - 1)

    max_dist = longest_by_topological_sort(N, nextnodes[0], nextnodes[1])
    print(max_dist)

Buggy submission (verdict: Runtime Error):
f=lambda:map(int,input().split())
N,M=f()
N+=1;V=[-1]*N
Q=list(range(N))
F,B=eval('{i:[]for i in Q},'*2)
for i in Q:x,y=f();F[x]+=[y];B[y]+=[x]
while Q:
 p=Q.pop();S=[1+V[q]for q in B[p]]
 if all(S)and V[p]<0:V[p]=max(S+[0]);Q+=F[p]
print(max(V))

Buggy submission (verdict: Runtime Error):
f=lambda:map(int,input().split())
N,M=f()
N+=1;V=[-1]*N
Q=[*range(N)]
F,B=eval('{i:[]for i in Q},'*2)
exec('x,y=f();F[x]+=[y];B[y]+=[x];'*M)
while Q:
 p=Q.pop();S=[1+V[q]for q in B[p]]
 if all(S)and V[p]<0:V[p]=max(S+[0]);Q+=F[p]
print(max(V))
Problem p03240 (python)

Fixed submission:
W = 101

def solve(xyh):
    for bx, by, bh in xyh:
        if bh > 0:
            break
    for yy in range(W):
        for xx in range(W):
            H = bh + abs(bx - xx) + abs(by - yy)
            for x, y, h in xyh:
                if max(H - abs(xx - x) - abs(yy - y), 0) != h:
                    break
            else:
                return (xx, yy, H)

N = int(input())
xyh = [tuple(map(int, input().split())) for i in range(N)]
print(*solve(xyh))

Buggy submission (verdict: Runtime Error):
W = 101

def solve(N, xyh):
    H = [[1e9] * W for i in range(W)]
    for x, y, h in xyh:
        for yy in range(W):
            for xx in range(W):
                if h == 0:
                    d = abs(xx - x) + abs(yy - y)
                    H[yy][xx] = min(H[yy][xx], d)
    V = [[-1] * W for i in range(W)]
    for x, y, h in xyh:
        for yy in range(W):
            for xx in range(W):
                d = abs(xx - x) + abs(yy - y)
                if h + d > H[yy][xx]:
                    V[yy][xx] = -2
                else:
                    if V[yy][xx] == -1:
                        V[yy][xx] = d + h
                    elif V[yy][xx] != d + h:
                        V[yy][xx] = -2
    for yy in range(W):
        for xx in range(W):
            if 1 <= V[yy][xx]:
                return (xx, yy, V[yy][xx])

if __name__ == '__main__':
    N = int(input())
    xyh = [tuple(map(int, input().split())) for i in range(N)]
    print(*solve(N, xyh))

Buggy submission (verdict: Runtime Error):
W = 101

def solve(N, xyh):
    for yy in range(W):
        for xx in range(W):
            H = set()
            Z = 1e9
            for x, y, h in xyh:
                d = abs(xx - x) + abs(yy - y)
                if h > 0:
                    H.add(d + h)
                else:
                    Z = min(Z, d)
            if len(H) == 1:
                h = H.pop()
                if 0 < h <= Z:
                    return (xx, yy, h)

N = int(input())
xyh = [tuple(map(int, input().split())) for i in range(N)]
print(*solve(N, xyh))

Buggy submission (verdict: Runtime Error):
W = 101

def solve(N, xyh):
    for yy in range(W):
        for xx in range(W):
            H = set()
            Z = W ** 2 # INF
            for x, y, h in xyh:
                d = abs(xx - x) + abs(yy - y)
                if h > 0:
                    H.add(d + h)
                else:
                    Z = min(Z, d)
            if len(H) == 1:
                h = H.pop()
                if h <= Z:
                    return (xx, yy, h)

N = int(input())
xyh = [tuple(map(int, input().split())) for i in range(N)]
print(*solve(N, xyh))
Problem p03241 (python)

Fixed submission:
N, M = map(int, input().split())
candidates = []
for p in range(1, max(int(M ** 0.5) + 1, N + 1)):
    if M % p == 0:
        if M // p >= N:
            # p * (M // p = a1+a2+.. >= N) = M
            candidates.append(p)
        if p >= N:
            # (M // p) * (p = a1+a2+.. >= N) = M
            candidates.append(M // p)
print(max(candidates))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
ps = range(1, N)
candidates = []
for p in ps:
    if M % p == 0:
        if M // p >= N:
            candidates.append(p)
        if p >= N:
            candidates.append(M // p)
print(max(candidates))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
pp = range(2, M // N + 2)
P = max(p for p in pp if M % p == 0 and M // p >= N)
print(P)
Problem p03262 (python)

Fixed submission:
try:
    from math import gcd # >=Python 3.5
except:
    from fractions import gcd # <Python 3.5 (AtCoder : 3.4)

def solve(X, xs):
    xs = list(xs) + [X]
    xs.sort()
    zs = [x - xs[0] for x in xs]

    for z in zs:
        if z == 0:
            D = z
        else:
            D = gcd(D, z)
    return D

def test():
    print(solve(13, [16 + 3 * 102485 * i for i in range(10**5)]))

if __name__=='__main__':
    N, X = map(int, input().split())
    xs = map(int, input().split())

    print(solve(X, xs))

Buggy submission (verdict: Runtime Error):
import math

def solve(X, xs):
    xs = list(xs) + [X]
    xs.sort()
    minx = min(xs)
    zs = [x - minx for x in xs]

    gcd = None
    for z in zs:
        if z == 0:
            gcd = z
        else:
            gcd = math.gcd(gcd, z)
    return gcd

def test():
    print(solve(13, [16 + 3 * 102485 * i for i in range(10**5)]))

if __name__=='__main__':
    N, X = map(int, input().split())
    xs = map(int, input().split())

    print(solve(X, xs))
Problem p02645 (python)

Fixed submission:
import sys
import random

def main():
    S = input()
    l = len(S)
    n = [0, 1, 2]
    out = S[n[0]] + S[n[1]] + S[n[2]]
    
    print(out)
main()

Buggy submission (verdict: Runtime Error):
import sys
import random

def main():
    S = input()
    l = len(S)
    n = [random.randint(0, l) for i in range(3)]
    out = S[n[0]] + S[n[1]] + S[n[2]]
    
    print(out)
main()
Problem p02646 (python)

Fixed submission:
import sys

def main():
    A, V = map(int, input().split())
    B, W = map(int, input().split())
    T = int(input())

    out = 'NO'

    if V==W:
        if B==A:
            out = 'YES'
            print(out)
            sys.exit()
        else:
            print(out)
            sys.exit()

    if B < A:
        t = (B - A) / (W - V)
    else:
        t = (B - A) / (V - W)
        
    if t >= 0:
        if t<=T:
            out = 'YES'
    
    print(out)
main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    A, V = map(int, input().split())
    B, W = map(int, input().split())
    T = int(input())

    out = 'NO'
    t = (B - A) / (V - W)
    if t >= 0:
        if t<=T:
            out = 'YES'
    
    print(out)
main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    A, V = map(int, input().split())
    B, W = map(int, input().split())
    T = int(input())

    out = 'NO'
    t = (B - A) / (V - W)
    if t > 0:
        if t<=T:
            out = 'YES'
    
    print(out)
main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    A, V = map(int, input().split())
    B, W = map(int, input().split())
    T = int(input())

    out = 'NO'
    t = (B - A) / (V - W)
    if t.is_integer()==True:
        t = int(t)
        if t > 0:
            if t<=T:
                out = 'YES'
    
    print(out)
main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    A, V = map(int, input().split())
    B, W = map(int, input().split())
    T = int(input())

    out = 'NO'
    t = (B - A) / (V - W)
    if isinstance(t, int):
        if t<=T:
            out = 'YES'
        
    print(out)
main()
Problem p02663 (python)

Fixed submission:
import sys
def main():
    H1, M1, H2, M2, K = map(int, input().split())
    
    h = H2 - H1 
    m = M2 - M1
    tot_minutes = h * 60 + m - K
    
    if tot_minutes <= 0:
        out = 0
    else:
        out = tot_minutes
    print(out)
main()

Buggy submission (verdict: Runtime Error):
import sys
def main():
    H1, M1, H2, M2, K = map(int, input().split())
    
    h = H2 - H1 
    m = M2 - M1
    tot_minutes = h * 60 + m - K
    if tot_minutes <= 0:
        out = 0
    print(out)
main()
Problem p02681 (python)

Fixed submission:

def main():
    S = input()
    T = input()

    S = S + str(T[-1])
    out='No'
    if S==T:
        out='Yes'
    print(out)
main()

Buggy submission (verdict: Runtime Error):
def main():
    A, B, C, K = map(int, input().split())
    l = []

    if K-A<0:
        out = K
    if K-A>=0:
        l.append(A)
        K = K-A
    if K-B>=0:
        K = K-B
    if K>0:
        m = K * -1
        l.append(m)
    out = sum(l)
    print(out)
main()
Problem p02713 (python)

Fixed submission:
from math import gcd
 
k=int(input())
 
ans=0
for i in range(1,k+1):
  for j in range(1,k+1):
    for l in range(1, k+1):
      ans+=gcd(gcd(i,j),l)
 
print(ans)

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

def gcd(*numbers):
    r = reduce(math.gcd, numbers)
    return r

def main():
    K = int(input())
    g = 0
    for i in range(1, K+1, 1):
        for j in range(1, K+1, 1):
            for k in range(1, K+1, 1):
            g += gcd(i, j, k)         
    print(g)
main()
Problem p02724 (python)

Fixed submission:
def main():
    x = int(input())
    
    a = x // 500
    x %= 500

    b = x // 5
    
    ans = 1000 * a + 5 * b
    print(ans)

main()

Buggy submission (verdict: Runtime Error):
def main():
    x = int(input())
    
    x // 500 = a
    x %= 500

    x // 5 = b
    
    ans = 1000 * a + 5 * b
    print(ans)

main()
Problem p02765 (python)

Fixed submission:
def main():
    K = 0
    N, R = [int(_) for _ in input().split()]
    if N >= 10:
        K = R
    else:
        K = R + 100 * (10 - N) 
    print(K)
main()

Buggy submission (verdict: Runtime Error):
def main():
    K = 0
    N, R = [int(_) for _ in input().split()]
    if N >= 10:
        K = R
    else:
        K = R + 100(10 - N) 
    print(K)
main()
Problem p02812 (python)

Fixed submission:
import sys

def main():
    N = int(input())
    S = input()

    cnt = 0
    for i in range(N-2):
        s = str(S[i:i+3])
        if s=='ABC':
            cnt += 1

    print(cnt)
main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    N = int(input().split())
    S = input()

    cnt = 0
    for i in range(N-2):
        s = str(S[i:i+2])
        if s=='ABC':
            cnt += 1

    print(cnt)
main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    N = int(input().split())
    S = input()

    cnt = 0
    for i in range(N-2):
        s = str(S[i]) + str(S[i+1]) + str(S[i+2])
        if s=='ABC':
            cnt += 1

    print(cnt)
main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    N = int(input().split())
    S = input()

    cnt = 0
    for i in range(N):
        s = str(S[i]) + str(S[i+1]) + str(S[i+2])
        if s=='ABC':
            cnt += 1

    print(cnt)
main()
Problem p03086 (python)

Fixed submission:
import sys

def main():
    S = input()
    l = len(S)
    
    ans = 0
    for i in range(l):
        for j in range(i, l):
            if all(['ATGC'.count(c) == 1 for c in S[i:j+1]]):
                ans = max(ans, j-i+1)
            
    print(ans)
main()

Buggy submission (verdict: Runtime Error):
import sys
 
def main():
    S = input()
    l = len(S)
    
    cnt_l = []
    
    for i in range(l):
        cnt = 0
        for j in range(l-i):
            if str(S[i+j]) in ['A', 'C', 'G', 'T']:
                cnt += 1
            else:
                cnt_l.append(cnt)
 
    out = max(cnt_l)
 
    print(out)
main()

Buggy submission (verdict: Runtime Error):
import sys
 
def main():
    S = input()
    l = len(S)
    
    cnt_l = []
    
    for i in range(l):
        cnt = 0
        for j in range(l-i):
            if str(S[i+j]) in ['A', 'C', 'G', 'T']:
                cnt += 1
            else:
                cnt_l.append(cnt)
 
    m = max(cnt_l)
 
    print(out)
main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    S = input()
    l = len(S)
    
    cnt_l = []
    
    for i in range(l):
        cnt = 0
        for j in range(l-i):
            if str(S[i+j]) in ['A', 'C', 'G', 'T']:
                cnt += 1
            else:
                cnt_l.append(cnt)

    m = max(cnt_l)
    if m==0:
        out = 0
    else:
        m_index = cnt_l.index(m)
        m_l = m + m_index
        out = S[m_index:m_l]

    print(out)
main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    S = input()
    l = len(S)
    
    cnt_l = []
    
    for i in range(l):
        cnt = 0
        for j in range(l-i):
            if str(S[i+j]) in ['A', 'C', 'G', 'T']:
                cnt += 1
            else:
                cnt_l.append(cnt)

    m = max(cnt_l)
    m_index = cnt_l.index(m)
    m_l = m + m_index
    out = S[m_index:m_l]

    print(out)
main()
Problem p03106 (python)

Fixed submission:
import math

def main():
    A, B, K = map(int, input().split())
    
    c_list = []
    
    for i in range(1, min(A, B)+1):
        if A%i==0 and B%i==0:
            c_list.append(i)
    c_list.reverse()
    print(c_list[K-1])
main()

Buggy submission (verdict: Runtime Error):
import math

def main():
    A, B, K = map(int, input().split())
    
    c_list = []
    
    for i in range(1, min(A, B)+1):
        if A%i==0 and B%i==0:
            c_list.append(i)
    print(c_list[K])
main()
Problem p03281 (python)

Fixed submission:
import sys

def main():
    N = int(input())
    
    cnt = 0
    for i in range(1, N+1, 2):
        prime_l = []
        for j in range(1, i+1, 2):
            if i%j==0:
                prime_l.append(j)
        if len(prime_l)==8:
            cnt+=1
    print(cnt)
main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    N = int(input())
    
    cnt = 0
    for i in range(1, N+1, 2):
        prime_l = []
        for j in range(1, i+1, 2):
            if i%j==0:
                prime_l.append()
        if len(prime_l)==8:
            cnt+=1
    print(cnt)
main()
Problem p03369 (python)

Fixed submission:
def main():
    S = input()
    cnt = 0
    for i in range(3):
        if S[i]=='o':
            cnt += 1
    ans = 700 + cnt * 100
    print(ans)
main()

Buggy submission (verdict: Runtime Error):
def main():
    S = input()
    cnt = 0
    for i in range(4):
        if S[i]=='o':
            cnt += 1
    ans = 700 + cnt * 100
    print(ans)
main()

Buggy submission (verdict: Runtime Error):
def main():
    S = input()
    cnt = 0
    for i in range(4):
        if S[i]=='o':
            cnt += 1
    ans = 700 + cnt * 100
    print(ans)
main()

Buggy submission (verdict: Runtime Error):
def main():
    S = input()
    cnt = 0
    for i in range(4):
        if s[i]=='o':
            cnt += 1
    ans = 700 + cnt * 100
    print(ans)
main()

Buggy submission (verdict: Runtime Error):
def main():
    S = int(input())
    cnt = 0
    for i in range(4):
        if s[i]=='o':
            cnt += 1
    ans = 700 + cnt * 100
    print(ans)
main()

Buggy submission (verdict: Runtime Error):
def main():
    S = int(input())
    cnt = 0
    for i in range(3):
        if s[i]=='o':
            cnt += 1
    ans = 700 + cnt * 100
    print(ans)
main()
Problem p03433 (python)

Fixed submission:
import sys

def main():
    N = int(input())
    A = int(input())
    x = N % 500
    if x<=A:
        print('Yes')
    else:
        print('No')

main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    N = input()
    A = input()
    x = N % 500
    if x<=A:
        print('Yes')
    else:
        print('No')

main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    N = input()
    A = input()
    x = N % 500
    if x<=A:
        print('Yes')
    else:
        print('No')

main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    N = input()
    A = input()
    x = N % 500
    if x%A==0:
        print('Yes')
    else:
        print('No')

main()
Problem p03693 (python)

Fixed submission:
import sys

def main():
    r, g, b = map(int, input().split())
    x = 10 * g + b
    if x%4==0:
        print('YES')
    else:
        print('NO')

main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    r, g, b = map(int(), input().split())
    x = 10 * g + b
    if x%4==0:
        print('YES')
    else:
        print('NO')

main()
Problem p02640 (python)

Fixed submission:
x,y = map(int,input().split())

for i in range(x+1):
    c = i
    t = abs(x-i)
    if 2*c + 4*t == y:
        print("Yes")
        break
    if i == x:
        print("No")
        break

Buggy submission (verdict: Runtime Error):
import sympy

x,y = map(int,input().split())

t = sympy.Symbol('t')
c = sympy.Symbol('c')

a = sympy.solve([t + c - x,4*t + 2*c - y],[t, c])

if a[t]<0 or a[c]<0:
    print("No")

elif a[t]%1 == 0 and a[c]%1 == 0:
    print("Yes")

else:
    print("No")
Problem p02641 (python)

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

if n == 0:
    print(x)

else:
    i = 1
    while True:
        t = x-i
        s = x+i
        if x not in p:
            print(x)
            break
        if t not in p:
            print(t)
            break
        if s not in p:
            print(s)
            break
        i +=1

Buggy submission (verdict: Runtime Error):
x,n = map(int,input().split())
p = list(map(int,input().split()))
if n == 0:
    print(x)
else:
    y2 = 100

    for i in range(1,max(p)+1):
        if x == i:
            continue
        if (i in p) == True:
            continue
    
        y1 = abs(i-x)
        if y2 > y1:
            y2 = y1
            t = i
    print(t)
Problem p02663 (python)

Fixed submission:
h1,m1,h2,m2,k = map(int,input().split())
x = (h2*60+m2-k)-(h1*60 + m1)
print(x)

Buggy submission (verdict: Runtime Error):
h1,m1,h2,m2,k = map(int,input().split())
if h1 < h2:
    x = (h2-h1)*60+(m1+m2)-k
elif h1 > h2:
    x = (24-(h1-h2))*60+(m1+m2)-k
print(x)
Problem p03455 (python)

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

if a*b%2 == 0:
    print('Even')
else:
    print('Odd')

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

if int(a*b%2) != 0:
    print('Odd')
else:
    print('Even')

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

if int(a*b%2) == 0:
    print('Even')
else:
    print('Odd')

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

if a*b%2 == 0:
    print('Even')
else:
    print('Odd')

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

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

Fixed submission:
n, m =map(int,input().split())
s = list(map(int,input().split()))
ans = 0
s.sort()
for _ in range(m):
  ans += s[_]
print(ans)

Buggy submission (verdict: Runtime Error):
n, m =map(int,input().split())
s = list(map(int,input().split()))
ans = 0
s = s.sort()
for _ in range(m):
  ans += s[_]
print(ans)
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(map(int,input().split()))
if 0 in s:
  print(0)
  exit()
for _ in range(n):
  ans *= s[_]
  if ans > 10**18:
    print(-1)
    exit()
else:
  print(ans)

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

Fixed submission:
n = int(input())
s = list(map(int,input().split()))
ans = 1
if 0 in s:
  print(0)
  exit()
for _ in range(n):
  ans *= s[_]
  if ans > 10**18:
    print(-1)
    exit()
else:
  print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(map(int,input().split()))
if 0 in s:
  print(0)
  exit()
for _ in range(n):
  ans *= s[_]
  if ans > 10**18:
    print(-1)
    exit()
else:
  print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(map(int,input().split()))
if 0 in s:
  print(0)
  exit()
for _ in range(n):
  ans *= s[_]
  if len(str((ans-1))) > 18:
    print(-1)
    exit()
else:
  print(ans)
Problem p02681 (python)

Fixed submission:
s = input()
t = input()

if s == t[:len(s)]:
  print("Yes")
else :
  print("No")

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
\\print(t[:len(s)])
if s == t[:len(s)]:
  print("Yes")
else :
  print("No")
Problem p02705 (python)

Fixed submission:
import math 
r = int(input())
print (str(2 *r * math.pi))

Buggy submission (verdict: Runtime Error):
n =int(input())
s = list(map(int,input().split()))
l =[0]*n
for i in range(n-1) :
     l[s[i]-1] += 1
for _ in range(n):
     print(l[_])

Buggy submission (verdict: Runtime Error):
n =int(input())
s = list(map(int,input().split()))
i = 1
l =[]
while i <= n:
     l.append(s.count(i))
     i += 1
[print(_) for _ in l]