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

Fixed submission:
import sys

n, q = map(int, sys.stdin.readline().split())

child = [[] for _ in range(n+1)]
for i in range(n-1):
    a, b = map(int, sys.stdin.readline().split())
    child[a].append(b)

score = [0] * (n+1)
for i in range(q):
    p, x = map(int, sys.stdin.readline().split())
    score[p] += x

wait = [1]

while True:
    target = wait.pop()
    for nex in child[target]:
        score[nex] += score[target]
        wait.append(nex)
    if len(wait) == 0:
        break

score.pop(0)

print(' '.join(map(str, score)))

Buggy submission (verdict: Runtime Error):
import sys

n, q = map(int, sys.stdin.readline().split())

near = [[] for _ in range(n+1)]
solved = [0] * n+1

child = [[] for _ in range(n+1)]
for i in range(n-1):
    a, b = map(int, sys.stdin.readline().split())
    near[a].append(b)
    near[b].append(a)

wait = [1]

while True:
    target = wait.pop()
    for nex in near[target]:
        if solved[nex] != 1:
            child[target].append(nex)
            wait.append(nex)
            solved[nex] = 1
        if len(wait) == 0:
            break

score = [0] * (n+1)
for i in range(q):
    p, x = map(int, sys.stdin.readline().split())
    score[p] += x

wait = [1]

while True:
    target = wait.pop()
    for nex in child[target]:
        score[nex] += score[target]
        wait.append(nex)
    if len(wait) == 0:
        break

score.pop(0)

print(' '.join(map(str, score)))
Problem p02882 (python)

Fixed submission:
import math
a, b, x = map(int, input().split())
h = x / (a * a)
if h == b / 2:
    answer = math.atan(a / b)
elif h < b / 2:
    answer = math.atan(2*h*a / (b * b))
else:
    if h == b:
        answer = math.pi / 2
    else:
        answer = math.atan(a / (2 * (b - h)))
print(90 - answer / math.pi * 180)

Buggy submission (verdict: Runtime Error):
import math
a, b, x = map(int, input().split())
h = x / (a * a)
if h == b / 2:
    answer = math.atan(a / b)
elif h < b / 2:
    answer = math.atan(2*h*a / (b * b))
else:
    answer = math.atan(a / (2 * (b - h)))
print(90 - answer / math.pi * 180)
Problem p02910 (python)

Fixed submission:
def tap_dance(st):
  size = len(st)
  for i in range(size):
    if (i+1) % 2 == 0:
      if st[i] not in "LUD":
        return "No"
    else:
      if st[i] not in "RUD":
        return "No"
  return "Yes"
st = input()
print(tap_dance(st))

Buggy submission (verdict: Runtime Error):
n, k, q = map(int, input().split())
ar = [k for i in range(n)]
for i in range(q):
  index = int(input())
  ar[index-1] += 1
for i in range(n):
  if ar[i] - q > 0:
    print("Yes")
  else:
    print("No")
Problem p02911 (python)

Fixed submission:
n, k, q = map(int, input().split())
ar = [k for i in range(n)]
for i in range(q):
  index = int(input())
  ar[index-1] += 1
for i in range(n):
  if ar[i] - q > 0:
    print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
n, k, q = map(int, input().split())
ar = [k for i in range(n)]
for i in range(q):
  index = int(input())
  ar[index] += 1
for i in range(n):
  if ar[i] - q > 0:
    print("Yes")
  else:
    print("No")
Problem p03796 (python)

Fixed submission:
n = int(input())
pi = 1
for i in range(1, n + 1):
    pi = (pi * i) % 1000000007
print(pi)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
if 2 * n >= m:
    print(m // 2)
else:
    a = m - 2 * n
    b = a // 4
    print(n + b)
Problem p03145 (python)

Fixed submission:
[print(a*b//2) for a,b,_ in [sorted(map(int, input().split()))]]

Buggy submission (verdict: Runtime Error):
[print(a*b//2)for a,b,_ in[[*map(int,input().split())]]]

Buggy submission (verdict: Runtime Error):
[print(a*b/2)for a,b,_ in[[*map(int,input().split())]]]
Problem p03288 (python)

Fixed submission:
print('A'+'BRG'[int(input())//100+4>>4]+'C')

Buggy submission (verdict: Runtime Error):
print'A%sC'%'BRG'[input()/100+4>>4]
Problem p03476 (python)

Fixed submission:
def isprime(x):
  if x < 2: return False
  for d in range(2, int(x**0.5)+1):
    if x % d == 0: return False
  return True

isp = list(map(isprime, range(100001)))
w = [0]*100001
for i in range(100001):
  if i > 2 and isp[i] and isp[(i + 1)//2]:
    w[i] = 1

for i in range(1,100001):
  w[i] += w[i-1]

Q = int(input())
for i in range(Q):
  L,R = map(int, input().split())
  print(w[R] - w[L-1])

Buggy submission (verdict: Runtime Error):

def isprime(x):
  if x < 2: return False
  for d in range(2, int(x**0.5)+1):
    if x % d == p: return False
  return True

isp = list(map(isprime, range(100001)))
w = [0]*100001
for i in range(100001):
  if i > 2 and isp[i] and isp[(i + 1)//2]:
    w[i] = 1

for i in range(1,100001):
  w[i] += w[i-1]

Q = int(input())
for i in range(Q):
  L,R = map(int, input().split())
  print(w[R] - w[L-1])
Problem p03674 (python)

Fixed submission:
n = int(input())
a = tuple(map(int, input().split()))
occur = [0 for i in range(n + 1)]
MOD = 1000000007
for i in range(n + 1):
    if occur[a[i]] > 0: val = n - 1 - i + occur[a[i]]
    else: occur[a[i]] = i + 1
inv = [0 if i > 2 else 1 for i in range(n + 2)]
pinv = [0 if i > 2 else 1 for i in range(n + 2)]
perm = [0 if i > 2 else 1 for i in range(n + 2)]
for i in range(2, n + 2):
    inv[i] = -int(MOD / i) * inv[MOD % i] + MOD
    pinv[i] = pinv[i - 1] * inv[i] % MOD
    perm[i] = perm[i - 1] * i % MOD
def C(n, m):
    return (perm[m] * pinv[n] % MOD) * pinv[m - n] % MOD if n <= m else 0
for i in range(1, n + 2):
    temp = C(i, n + 1) - C(i - 1, val)
    if temp < 0: temp += MOD
    print(temp)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = map(int, input().split())
occur = [0 for i in range(100005)]
x = 0
cnt = 0
for i in a:
    cnt += 1
    if occur[i] > 0:
        x = n + 1 - cnt + occur[i]
    else:
        occur[i] = cnt
print(n)
res1 = n + 1
res2 = 1
for i in range(1, n + 1):
    res1 = res1 * (n + 1 - i) / (i + 1)
    if res2 >= 1: res2 = res2 * (x - i) / i
    print(int((res1 - res2 + 1000000007) % 1000000007))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = map(int, input().split())
occur = [0 for i in range(n + 1)]
x = 0
cnt = 0
for i in a:
    cnt += 1
    if (occur[i] > 0):
        x = n + 1 - cnt + occur[i]
    else:
        occur[i] = cnt
print(n)
res1 = n + 1
res2 = 1
for i in range(1, n + 1):
    res1 = res1 * (n + 1 - i) / (i + 1)
    if (res2 >= 1): res2 = res2 * (x - i) / i
    print(int((res1 - res2 + 1000000007) % 1000000007))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = map(int, input().split())
occur = [0 for i in range(n + 1)]
x = 0
cnt = 0
for i in a:
    cnt += 1
    if (occur[i] > 0):
        x = n + 1 - cnt + occur[i]
    else:
        occur[i] = cnt
print(n)
res1 = n + 1
res2 = 1
for i in range(1, n + 1):
    res1 = int(res1 * (n + 1 - i) / (i + 1))
    res2 = int(res2 * (x - i) / i)
    print(int((res1 - res2 + 1000000007) % 1000000007))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = map(int, input().split())
occur = [0 for i in range(n + 1)]
x = 0
cnt = 1
for i in a:
    cnt += 1
    if (occur[i] > 0):
        x = n + 1 - cnt + occur[i]
    else:
        occur[i] = cnt
print(n)
res1 = n + 1
res2 = 1
for i in range(1, n + 1):
    res1 = res1 * (n + 1 - i) / (i + 1)
    res2 = res2 * (x - i) / i
    print(int((res1 - res2 + 1000000007) % 1000000007))
Problem p03166 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10000000)
def calc(dp,adj,i):
    if(len(adj[i])==0):
        dp[i]=0
    elif dp[i]>0:
        return dp[i]
    else:
        for j in adj[i]:
            dp[i]=max(dp[i],calc(dp,adj,j))
        dp[i]+=1
    return dp[i]
n,m=map(int,input().split())
adj=[]
for i in range(n+1):
    adj.append([])
for i in range (m):
    x,y=map(int,input().split())
    adj[x].append(y)
dp=[-1]*(n+1);
for i in range(1,n+1):
    calc(dp,adj,i)
print(max(dp))

Buggy submission (verdict: Runtime Error):
sys.setrecursionlimit(10000000)
def calc(dp,adj,i):
    if(len(adj[i])==0):
        dp[i]=0
    elif dp[i]<0:
        for j in adj[i]:
            dp[i]=max(dp[i],calc(dp,adj,j))
        dp[i]+=1
    return dp[i]
n,m=map(int,input().split())
adj=[]
for i in range(n+1):
    adj.append([])
for i in range (m):
    x,y=map(int,input().split())
    adj[x].append(y)
dp=[-1]*(n+1);
for i in range(1,n+1):
    calc(dp,adj,i)
print(max(dp))

Buggy submission (verdict: Runtime Error):
def calc(dp,adj,i):
    if(len(adj[i])==0):
        dp[i]=0
    elif dp[i]<0:
        for j in adj[i]:
            dp[i]=max(dp[i],calc(dp,adj,j))
        dp[i]+=1
    return dp[i]
n,m=map(int,input().split())
adj=[]
for i in range(n+1):
    adj.append([])
for i in range (m):
    x,y=map(int,input().split())
    adj[x].append(y)
dp=[-1]*(n+1);
for i in range(1,n+1):
    calc(dp,adj,i)
print(max(dp))
Problem p02719 (python)

Fixed submission:
N, K = list(map(int, input().split()))

print(min(N % K, K - (N % K)))

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

if N >= K:
    print(N % K)
else:
    print(K % N)
Problem p02787 (python)

Fixed submission:
h, n = list(map(int, input().split()))
ab = []
for i in range(n):
    a, b = list(map(int, input().split()))
    ab.append((a, b))
ab.sort(key=lambda ab: (ab[0]/ab[1], -ab[0]), reverse=True)

import sys
sys.setrecursionlimit(100000000)

mem = [-1 for i in range(h)]
def solve(h):
    best = float('inf')
    for a,b in ab:
        if h - a <= 0:
            val = b
        else:
            if mem[h - a] != -1:
                val = b + mem[h - a]
            else:
                mem[h - a] = solve(h - a)
                val = b + mem[h-a]
        if val < best:
            best = val
        else:
            break
    return best

print(solve(h))

Buggy submission (verdict: Runtime Error):
h, n = list(map(int, input().split()))
ab = []
for i in range(n):
    a, b = list(map(int, input().split()))
    ab.append((a, b))
ab.sort(key=lambda ab: (ab[0]/ab[1], -ab[0]), reverse=True)

import sys
sys.setrecursionlimit(1500)

mem = [-1 for i in range(h)]
def solve(h):
    best = float('inf')
    for a,b in ab:
        if h - a <= 0:
            val = b
        else:
            if mem[h - a] != -1:
                val = b + mem[h - a]
            else:
                mem[h - a] = solve(h - a)
                val = b + mem[h-a]
        if val < best:
            best = val
        else:
            break
    return best

print(solve(h))

Buggy submission (verdict: Runtime Error):
h, n = list(map(int, input().split()))
ab = []
for i in range(n):
    a, b = list(map(int, input().split()))
    ab.append((a, b))
ab.sort(key=lambda ab: (ab[0]/ab[1], -ab[0]), reverse=True)

mem = [-1 for i in range(h)]
def solve(h):
    best = float('inf')
    for a,b in ab:
        if h - a <= 0:
            val = b
        else:
            if mem[h - a] != -1:
                val = b + mem[h - a]
            else:
                mem[h - a] = solve(h-a)
                val = b + mem[h-a]
        if val < best:
            best = val
        else:
            break
    return best

print(solve(h))
Problem p02803 (python)

Fixed submission:
import collections
h, w = list(map(int, input().split()))

s = []
for i in range(h):
    line = input()
    s.append(line)

ans = 0
for i in range(h):
    for j in range(w):
        if s[i][j] == '#':
            continue
        d = [[False for x in range(w)] for y in range(h)]

        stack = collections.deque()
        stack.append((i, j, 0))
        d[i][j] = True
        while stack:
            y, x, score = stack.popleft()
            if y > 0 and s[y-1][x] == '.' and not d[y-1][x]:
                stack.append((y-1, x, score+1))
                d[y-1][x] = True
            if x < w-1 and s[y][x+1] == '.' and not d[y][x+1]:
                stack.append((y, x+1, score+1))
                d[y][x+1] = True
            if y < h-1 and s[y+1][x] == '.' and not d[y+1][x]:
                stack.append((y+1, x, score+1))
                d[y+1][x] = True
            if x > 0 and s[y][x-1] == '.' and not d[y][x-1]:
                stack.append((y, x-1, score+1))
                d[y][x-1] = True
            if score > ans:
                ans = score
print(ans)

Buggy submission (verdict: Runtime Error):
    h, w = list(map(int, input().split()))
     
    s = []
    for i in range(h):
        line = input()
        s.append(line)
     
    ans = []
    for i in range(h):
        for j in range(w):
            if s[i][j] == '#':
                continue
            d = [[1<<10 for x in range(w)] for y in range(h)]
     
            stack = []
            stack.append((i, j))
            d[i][j] = 0
            while stack:
                y, x = stack.pop()
                if y > 0 and s[y-1][x] == '.' and d[y-1][x] > d[y][x]+1:
                    d[y-1][x] = d[y][x] + 1
                    stack.append((y-1, x))
                if x < w-1 and s[y][x+1] == '.' and d[y][x+1] > d[y][x]+1:
                    d[y][x+1] = d[y][x] + 1
                    stack.append((y, x+1))
                if y < h-1 and s[y+1][x] == '.' and d[y+1][x] > d[y][x]+1:
                    d[y+1][x] = d[y][x] + 1
                    stack.append((y+1, x))
                if x > 0 and s[y][x-1] == '.' and d[y][x-1] > d[y][x]+1:
                    d[y][x-1] = d[y][x] + 1
                    stack.append((y, x-1))
            ma = 0
            for y in range(h):
                for x in range(w):
                    if d[y][x] > ma:
                        ma = d[y][x]

            ans.append(ma)
    ans.sort()
    print(ans[-1])
Problem p02814 (python)

Fixed submission:
import fractions
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))

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

ma = 0
mod2count = -1
for i in range(n):
    if mod2count == -1:
        mod2count = bin(a[i])[2:][::-1].find('1')
    if mod2count != bin(a[i])[2:][::-1].find('1'):
        print(0)
        exit()
    a[i] = a[i] // 2
    if a[i] > ma:
        ma = a[i]

l = a[0]
for i in range(1, n):
    l = lcm(l, a[i])

tmp = m // l
if tmp % 2 == 0:
    print(tmp // 2)
else:
    print(tmp // 2 + 1)

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

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

ma = 0
is2 = False
for i in range(n):
    if a[i] == 2:
        is2 = True
    a[i] = a[i] // 2
    if a[i] > ma:
        ma = a[i]

l = a[0]
for i in range(1, n):
    l = lcm(l, a[i])

if is2 and l % 2 == 0:
    print(0)
    return

tmp = m // l
if tmp % 2 == 0:
    print(tmp // 2)
else:
    print(tmp // 2 + 1)

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

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

ma = 0
for i in range(n):
    a[i] = a[i] // 2
    if a[i] > ma:
        ma = a[i]
l = a[0]
for i in range(1, n):
    l = lcm(l, a[i])

tmp = m // l
if tmp % 2 == 0:
    print(tmp // 2)
else:
    print(tmp // 2 + 1)

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

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

ma = 0
for i in range(n):
    a[i] = a[i] // 2
    if a[i] > ma:
        ma = a[i]
l = a[0]
for i in range(1, n):
    l = lcm(l, a[i])
ans = ((m - ma) // (l * 3))
if (m - ma) // l // 2 == 0:
    print(0)
else:
    print((m - ma) // l // 2 + 1)

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

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

ma = 0
for i in range(n):
    a[i] = a[i] // 2
    if a[i] > ma:
        ma = a[i]
l = a[0]
for i in range(1, n):
    l = lcm(l, a[i])
ans = ((m - ma) // (l * 3))
if (m - ma) // l // 2 == 0:
    print(0)
else:
    print((m - ma) // l // 2 + 1)
Problem p02658 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
i = 0
ans = 1
if 0 in a:
    print(0)
else:
    while ans<10**18 and i < len(a):
        ans*=a[i]
        i+=1
    if ans<=10**18:
        print(ans)
    else:
        print(-1)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
i = 0
ans = 1
if 0 in a:
    print(0)
else:
    while ans<10**18:
        ans*=a[i]
        i+=1
    if ans<=10**18:
        print(ans)
    else:
        print(-1)
Problem p02945 (python)

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

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split()
ans = max(a+b), a-b)
ans = max(ans, a*b)
print(ans)
Problem p02681 (python)

Fixed submission:
S = input()

T = input()

x = T[0:-1]

if S == x:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
S = input()

T = input()

x = T[0:-1]

if S == x and :
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
S = input()
T = input()

x = T - S

y = len(x)

if y == 1:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
S = input()

a = input()

T = S + a

if T - a == S:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
S = input()

a = input()

T = S + a

if T - a = S:
    print('YES')
else:
    print('NO')
Problem p02687 (python)

Fixed submission:
S = input()

if S == 'ABC':
    print('ARC')
else:
    print('ABC')

Buggy submission (verdict: Runtime Error):
S = input()

if S = 'ABC':
    print('ARC')
else:
    print('ABC')

Buggy submission (verdict: Runtime Error):
S = str(input())

if S = 'ABC':
    print('ARC')
else:
    print('ABC')
Problem p02705 (python)

Fixed submission:
import math

r=float(input())

print(2*r*math.pi)

Buggy submission (verdict: Runtime Error):
import math

r=int(import())

print(r*math.pi*2)
Problem p02658 (python)

Fixed submission:
N=int(input())
a=list(map(int,input().split()))
sum_=1
if 0 in a:
    print (0)
else:
    for i in range(N):
        sum_ *= a[i]
        if sum_> 10**18:
            sum_ =-1
            break
    print(sum_)

Buggy submission (verdict: Runtime Error):
N=int(input())
a=list(map(int,input().split()))
sum_=1
for i in range(N):
    while sum_ < 10**18:
        sum_ *= a[i]
        if sum_ > 10**18:
            sum_ =-1
        break
        if sum_ = 0:
        break
print(sum_)

Buggy submission (verdict: Runtime Error):
N=int(input())
a=list(map(int,input().split()))
sum_=1
for i in range(N):
    while sum_ < 10**18:
        sum_ *= a[i]
        if sum_ > 10**18:
            sum_ =-1
        break
        if sum_ = 0:
            break
print(sum_)
Problem p02657 (python)

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

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

def solve(n):
    res = 0
    for i in range(2, int(n ** 0.5) + 2):
        cnt = 0
        while n % pow(i, cnt + 1) == 0:
            n /= pow(i, cnt + 1)
            cnt += 1
            if n % pow(i, cnt + 1) != 0:
                res += cnt
                break
    
    if n != 1:
            res = 1
    
    return res

print(solve(n))

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

Fixed submission:
n = int(input()) % 10
if n in {2, 4, 5, 7, 9}:
    print('hon')
elif n in {0, 1, 6, 8}:
    print('pon')
else:
    print('bon')

Buggy submission (verdict: Runtime Error):
n = int(input()) % 10
if n in {2, 4, 5, 7, 9}:
    print('hon')
elif n in {0, 1, 6, 8}:
    print('pon')
else
    print('bon')
Problem p02730 (python)

Fixed submission:
def pal(t):
  return t == t[::-1];


s = input();
f = pal(s) and pal(s[0:len(s)//2:]) and pal(s[(len(s)//2 + 1)::]);
#f = pal(s);
if f == True:
  print("Yes");
else:
  print("No");

Buggy submission (verdict: Runtime Error):
def pal(s):
  f = True;
  i = 0;
  l = s.size() - 1;
  while i < l - i:
    if s[i] != s[l - i]:
      f = false;
	i++;
  return f;

s = input();
f = pal(s) and pal(s[0:(n//2 - 1):]) and pal(s[(n//2 + 1)::]);
if f == True:
  print("Yes");
else:
  print("No");
Problem p03254 (python)

Fixed submission:
N,X = map(int,input().split(' '))
num_list = list(map(int,input().split(' ')))
num_list_s = sorted(num_list)
total = 0
index = 0
for i in range(N):
    total += num_list_s[i]
    if total > X:
        break
    else:
        index += 1
if sum(num_list) < X:
    print(index-1)
else:
    print(index)

Buggy submission (verdict: Runtime Error):
N,X = map(int,input().split(' '))
num_list = list(map(int,input().split(' ')))
num_list_s = sorted(num_list)
total = 0
index = 0
for i in range(N):
    total += num_list_s[i]
    if total > X:
        break
    else:
        index += 1
if sum(num_list) < x:
    print(index-1)
else:
    print(index)
Problem p03427 (python)

Fixed submission:
N = input()
Dig = len(N)
num = None
if Dig == 1:
    print(N)
else:
    for i in range(Dig-1):
        if N[i+1] != str(9):
            num = i
            break
        else:
            continue
    list_num = list(N)
    if not num == None:
        target = int(list_num[num]) -1
        array = list(map(int,N))
        ans = sum(array[:num]) + target + 9*(Dig-num-1)
        print(ans)
    else:
        array = list(map(int,N))
        print(sum(array))

Buggy submission (verdict: Runtime Error):
N = input()
Dig = len(N)
if Dig == 1:
    print(N)
else:
    for i in range(Dig):
        if N[i] != 9:
            num = i
            break
        else:
            continue
    list_num = list(N)
    target = int(list_num[num]) -1
    ans = 9*(num -1) + target + 9*(DIg)
    print(ans)
Problem p02658 (python)

Fixed submission:
i = input
i()
x = 1
l = i().split()
if '0' in l:
    print(0)
    quit()
for j in l:
    x *= int(j)
    if x > 1e18:
        print(-1)
        quit()
print(x)

Buggy submission (verdict: Runtime Error):
input();l=input().split();x=1
for j in sorted(l):
  x:=x*int(j)if x>1e18or x<0else-1
print(x)

Buggy submission (verdict: Runtime Error):
input();l=input().split();x=not'0'in l
for j in l:
  x=x*int(j)if x>1e18or x<0
print(x)

Buggy submission (verdict: Runtime Error):
input();l=input().split();x=1
for j in sorted(l):x*=int(j)
  if x>1e18:x=-1;break
print(x)

Buggy submission (verdict: Runtime Error):
input();l=input().split();x=not'0'in l
for j in l:
  x*=int(j);if x>1e18:x=-1;break
print(x)

Buggy submission (verdict: Runtime Error):
i=input;i();l=i().split();x=1-('0'in l)
for j in l:
  x*=int(j);if x>1e18:x=-1;break
print(x)

Buggy submission (verdict: Runtime Error):
i=input;i();l=i().split();x=1-('0'in l)
for j in l:
  x*=j-48
  if x>1e18:
    print(-1);quit()
print(x)
Problem p02969 (python)

Fixed submission:
r=int(input())
print(3*r**2)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[]
for i in range(n):
    a.append(int(input()))
c=max(a)
check=False
for i in range(n):
    if a[i]==c&&check==False:
        b=a[:i]+a[i+1:]
        d=max(b)
        print(d)
    elif a[i]==c&&check==True:
        print(d)
    else:
        print(c)
Problem p03210 (python)

Fixed submission:
x=int(input())
if x==5 or x==7 or x==3:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
x=input();print(["NO","YES"][x in ["3","5","7"])
Problem p03211 (python)

Fixed submission:
x=input()
ans=abs(int(x[0:3])-753)
for i in range(len(x)-2):
    if abs(int(x[i:i+3])-753)<ans:
        ans=abs(int(x[i:i+3])-753)
print(ans)

Buggy submission (verdict: Runtime Error):
x=input();a=999
while i<len(x)-2:a=min(abs(int(x[i:i+3])-753),a);i+=1
print(a)