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

Fixed submission:
#! /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
N, L = map(int, input().split())
S = []
for i in range(N):
    S.append(input())
print(('').join(sorted(S)))

Buggy submission (verdict: Runtime Error):
N, L = map(int, input().split())
S = []
for i in rangeN):
    S.append(input())
print(('').join(sorted(S)))
Problem p02706 (python)

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

total = 0
for i in range(M):
  total += A[i]
  
if N - total >= 0:
  print(N - total)
  
else:
  print("-1")

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

total = 0
for i in range(M):
  total += A[i]
  
if N - total >= 0:
  print(N - total)
  
else:
  print("-1")
Problem p02741 (python)

Fixed submission:
k_list = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

K = int(input())
print(k_list[K-1])

Buggy submission (verdict: Runtime Error):
k_list = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K = int(input())

print(k_list[K])
Problem p02742 (python)

Fixed submission:
H,W = map(int,input().split())
 
if H == 1 or W == 1:
  print(1)
else:
  cnt = (H * W + 1) // 2
  print(cnt)

Buggy submission (verdict: Runtime Error):
H,W = map(int,input().split())

if H == 1 or W == 1:
  return 1
else:
  cnt = (H * W + 1) // 2
  return cnt

Buggy submission (verdict: Runtime Error):
H,W = map(int,input().split())

ban = []

for j in range(W):
  ban.append(0)

banmen=[]

for i in range(H):
  banmen.append(ban)
  
banmen[0][0] = 1
cnt = 1

for i in range(H):
  for j in range(W):
    if banmen[i][j] != 1:
      continue
    if i-1 >= 0 and j-1 >= 0 and banmen[i-1][j-1] != 1:
      banmen[i-1][j-1] = 1
      cnt+=1
    elif i-1 >= 0 and j+1 <= len(ban) and banmen[i-1][j+1] != 1:
      banmen[i-1][j+1] = 1
      cnt+=1
    elif i+1 <= H and j-1 >= 0 and banmen[i+1][j-1] != 1:
      banmen[i+1][j-1] = 1
      cnt+=1
    elif i+1 <= H and j+1 <= W and banmen[i+1][j+1] != 1:
      banmen[i+1][j+1] = 1
      cnt+=1
print(cnt)
Problem p02743 (python)

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

d = c-b-a

if d > 0 and d**2 > 4*a*b:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import math

x,y,z = map(int,input())

x = math.sqrt(x)
y = math.sqrt(y)
z = math.sqrt(z)

if x + y < z:
  print("Yes")
else:
  print("No")
Problem p02639 (python)

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

for i in range(len(x)):
    if x[i] == 0:
        print(i+1)

Buggy submission (verdict: Runtime Error):
x = list(map(int, input().split()))
x_l = [1,2,3,4,5]

for i in range(ren(x_l)):
    if x_l[i] != x[i]:
        print(i+1)
Problem p02687 (python)

Fixed submission:
s = input()

if s == "ABC":
    print("ARC")
if s == "ARC":
    print("ABC")

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

if s is "ABC":
  print("ARC"):
else:
  print("ABC")
Problem p02700 (python)

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

flag = False
for idx in input_list:
    if idx>=1 and idx<=100:
        flag = True
    if flag is False:
        break
  
turn = 0
if flag:
    A, B, C, D = input_list
    continue_flag = True
    while continue_flag:
        if turn%2==0:
          C -= B
          if C<=0:
            print("Yes")
            continue_flag = False
          turn += 1
        else:
          A -= D
          if A<=0:
            print("No")
            continue_flag = False
          turn += 1

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

flag = False
for idx in input_list:
  if idx>=1 and idx<=100:
    flag = True
  if flag is False:
    break
  
turn = 0
if flag:
  A, B, C, D = input_list
  continue_flag = True
  while continue_flag:
    if turn%2==0:
      C -= B
      if C<=0:
        print("Yes")
        continue_flag = False
      turn += 1
    else:
      A -= D
      if A<=0:
        print("No")
        continue_flag = False
      turn += 1
Problem p02612 (python)

Fixed submission:
money = int(input())

for i in range(1, 11):
    if money <= i * 1000 :
        print(i * 1000 - money)
        exit()
    else:
        pass

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

ac_count = 0
wa_count = 0
tle_count = 0
re_count = 0

for i in range(loop_count):
    result = input()
    if result == 'AC':
        ac_count += 1
    elif result == 'WA':
        wa_count += 1
    elif result == 'TLE':
        tle_count += 1
    else:
        re_count += 1

print("AC x {0}".format(str(ac_count)))
print("WA x {0}".format(str(wa_count)))
print("TLE x {0}".format(str(tle_count)))
print("RE x {0}".format(str(re_count)))
Problem p02555 (python)

Fixed submission:
s = int(input())

dp = [0]*(2001)
MOD = 10**9+7

dp[0] = 1
dp[1] = 0
dp[2] = 0

if s >= 3:
    for i in range(3, s+1):
        dp[i] = (dp[i-1] + dp[i-3]) % MOD
    print(dp[s])
else:
    print("0")

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

dp = [0]*(s+1)
MOD = 10**9+7

dp[0] = 1
dp[1] = 0
dp[2] = 0

if s >= 3:
    for i in range(3, s+1):
        dp[i] = (dp[i-1] + dp[i-3]) % MOD
    print(dp[s])
else:
    print(0)
Problem p02608 (python)

Fixed submission:
from numba import jit

N = int(input())

@jit
def f():
    ret = [0] * 10001

    for i in range(1, 200):
        for j in range(1, 200):
            for k in range(1, 200):
                z = i**2 + j**2 + k**2 + i*j + j*k + k*i
                if z < 10001:
                    ret[z] += 1

    return ret


ans = f()

for x in range(1, N+1):
    print(ans[x])

Buggy submission (verdict: Runtime Error):
from numba import jit

N = int(input())

@jit
def f():
    ret = [0] * 10000

    for i in range(1, 200):
        for j in range(1, 200):
            for k in range(1, 200):
                z = i**2 + j**2 + k**2 + i*j + j*k + k*i
                if z < 10000:
                    ret[z] += 1

    return ret


ans = f()

for x in range(1, N+1):
    print(ans[x])
Problem p02614 (python)

Fixed submission:
import itertools

H, W, K = map(int, input().split())
C = []
 
for i in range(H):
    C.append(input())

ans = 0

for i in range(H+1):
    for j in range(W+1):
        for m in itertools.combinations(list(range(H)), i):
            for n in itertools.combinations(list(range(W)), j):
                count = 0
                for a in m:
                    for b in n:
                        if(C[a][b] == "#"):
                            count += 1
                if(count == K):
                    ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
import itertools

H, W, K = map(int, input().split())
C = []
 
for i in range(H):
    C.append(input())

ans = 0

for i in range(H+1):
    for j in range(W+1):
        for m in itertools.combinations(list(range(H)), i):
            for n in itertools.combinations(list(range(W)), j):
                count = 0
                for a in m:
                    for b in n:
                        if(C[b][a] == "#"):
                            count += 1
                if(count == K):
                    ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
import itertools

H, W, K = map(int, input().split())
C = []
 
for i in range(H):
    C.append(input())

ans = 0

for i in range(H+1):
    for j in range(W+1):
        for m in itertools.combinations(list(range(H)), i):
            for n in itertools.combinations(list(range(W)), j):
                count = 0
                for a in m:
                    for b in n:
                        if(C[b][a] == "#"):
                            count += 1
                if(count == K):
                    ans += 1

print(ans)
Problem p02642 (python)

Fixed submission:
import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

n = int(readline())
a = np.array(read().split(), np.int32)

b = np.zeros(10**6 + 10, np.int32)
cnt = 0

for x in a:
    if b[x] > 1:
        continue
    b[::x] += 1

for x in a:
    if b[x] == 1:
        cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline


def f(a):
    for i in range(n-1):
        b[i] = a[i] % a[i+1]
    return b


n, *a = map(int, read().split())

b = [0] * n

a = sorted(a, reverse=True)
z = 0

while a[len(a)] == 0:
    a = f(a)
    z += 1

print(z-1)
Problem p02702 (python)

Fixed submission:
s = input()

mod = [0] * 2019
mod[0] = 1
d = 1
n = 0
ans = 0

for i in reversed(s):
    n += int(i) * d
    n %= 2019
    d *= 10
    d %= 2019
    mod[n % 2019] += 1

for x in range(2019):
    ans += mod[x] * (mod[x]-1) // 2

print(ans)

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

mod = [0] * 2019
mod[0] = 1
d = 1
n = 0
ans = 0

for i in reversed(s):
    n += int(i) * d
    n %= 2019
    d *= 10
    d %= 2019
    mod[n % 2019] += 1

for i in mod:
    ans += sum(i*(i-1) // 2)

print(ans)
Problem p02743 (python)

Fixed submission:
from decimal import Decimal

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

if Decimal(a).sqrt() + Decimal(b).sqrt() < Decimal(c).sqrt():
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import math

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

if math.sqrt(a) + math.sqrt(b) > 31,622.77660168379:
    print("No")
else:
    if math.sqrt(a) + math.sqrt(b) < math.sqrt(c):
        print("Yes")
    else:
        print("No")
Problem p02768 (python)

Fixed submission:
from functools import reduce
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

n, a, b = map(int, read().split())
MOD = 10 ** 9 + 7


def comb_mod(n, a):
    num = reduce(lambda x, y: x * y % MOD, range(n, n - a, -1))
    den = reduce(lambda x, y: x * y % MOD, range(1, a + 1))
    return num * pow(den, MOD - 2, MOD) % MOD


ans = pow(2, n, MOD) - comb_mod(n, a) - comb_mod(n, b) - 1
ans %= MOD

print(ans)

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

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

n, a, b = map(int, read().split())
MOD = 10 ** 9 + 7


def combo_mod(n, a):
    t = reduce(lambda x, y: x * y % MOD, range(n, n - a, -1))
    b = reduce(lambda x, y: x * y % MOD, range(1, a + 1))
    return t // b


ans = pow(2, n, MOD) - combo_mod(a) - combo_mod(b) - 1
ans %= MOD

print(ans)
Problem p02789 (python)

Fixed submission:
n, m = map(int, input().split())

if n == m:
    print("Yes")
else:
    print("No")

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

cnt = 1
min_p = p[0]

if n == 1:
    print(n)
else:
    for i in range(1, n):
        if p[i] < min_p:
            min_p = p[i]
            cnt += 1
    print(cnt)
Problem p02802 (python)

Fixed submission:
n, m = map(int, input().split())

p = [0] * m
s = [0] * m
ac = [0] * n
wa = [0] * n

for i in range(m):
    p[i], s[i] = input().split()

p = [int(i) for i in p]
 
for i in range(m):
    if ac[p[i] - 1] == 0:
        if s[i] == 'AC':
            ac[p[i] - 1] = 1
        else:
            wa[p[i] - 1] += 1

for i in range(n):
    if ac[i] == 0:
        wa[i] = 0

print(sum(ac), sum(wa))

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

p = [0] * m
s = [0] * m
ac = [0] * n
wa = [0] * n

for i in range(m):
    p[i], s[i] = input().split()
 
for i in range(m):
    if ac[p[i] - 1] == 0:
        if s[i] == 'AC':
            ac[p[i] - 1] = 1
        else:
            wa[p[i] - 1] += 1

for i in range(n):
    if ac[i] == 0:
        wa[i] = 0

print(sum(ac), sum(wa))
Problem p02814 (python)

Fixed submission:
from fractions import gcd
from functools import reduce

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
N, M, *A = map(int, read().split())
 
# 「奇数倍」に帰着
A = [x >> 1 for x in A]
 

def merge(a, b):
    g = gcd(a, b)
    a //= g
    b //= g
    if a % 2 == 0:
        return 0
    if b % 2 == 0:
        return 0
    n = a * b * g
    if n > 10 ** 9:
        return 0
    return n


x = reduce(merge, A)

if x == 0:
    answer = 0
else:
    answer = (M//x) - (M//(x+x))
 
print(answer)

Buggy submission (verdict: Runtime Error):
import sys
from fractions import gcd

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


def merge(a, b):
    g = gcd(a, b)
    a //= g
    b //= g
    if a % 2 == 0:
        return 0
    if b % 2 == 0:
        return 0
    n = a * b * g
    if n > 10 ** 9:
        return 0
    return n


n, m = map(int, readline().split())
a = list(map(int, readline().split()))

a = [x >> 1 for x in a]

for i in range(n-1):
    a[i+1] = int(a[i] * a[i+1] / merge(a[i], a[i+1]))

if a[n-1] > 10**9:
    print("0")
else:
    t = m // a[i+1]
    ans = (m // a[i+1]) - (m // (a[i+1] * 2))
    print(ans)

Buggy submission (verdict: Runtime Error):
import sys
from fractions import gcd

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n, m = map(int, readline().split())
a = list(map(int, readline().split()))

a = [x >> 1 for x in a]

for i in range(n-1):
    a[i+1] = int(a[i] * a[i+1] / gcd(a[i], a[i+1]))

if a[n-1] > 10**9:
    print("0")
else:
    t = m // a[i+1]
    ans = (m // a[i+1]) - (m // (a[i+1] * 2))
    print(ans)

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

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n, m = map(int, readline().split())
a = list(map(int, readline().split()))

for i in range(n-1):
    a[i+1] = int(a[i] * a[i+1] / math.gcd(a[i], a[i+1]))

t = (a[n-1] // 2)
t = m // t
ans = math.ceil(t / 2)
print(ans)

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

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n, m = map(int, readline().split())
a = list(map(int, readline().split()))

for i in range(n-1):
    a[i+1] = int(a[i] * a[i+1] / gcd(a[i], a[i+1]))

t = (a[n-1] // 2)
t = m // t
ans = math.ceil(t / 2)
print(ans)
Problem p02838 (python)

Fixed submission:
import numpy as np
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n = int(readline())
a = np.array(read().split(), np.int64)

mod = 10 ** 9 + 7
ans = 0

for i in range(61):
    b = a >> i & 1
    x = np.count_nonzero(b)
    y = n - x
    z = x * y
    z *= 2 ** i
    z %= mod
    ans += z
ans %= mod

print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n = int(input())
a = np.array(read().split(), np.int64)

mod = 10 ** 9 + 7
ans = 0
b = [0] * len(a)

for i in range(61):
    for j in range(n):
        b[j] = (a[j] >> i) & 1
    x = len(b) - sum(b)
    y = n - x
    z = x * y
    z *= 2 ** i
    z %= mod
    ans += z
ans %= mod

print(ans)
Problem p02843 (python)

Fixed submission:
x = int(input())

# 商品の合計がi個の場合の可能なxの範囲
# i=1   100-105
# i=2   200-210
# i=3   300-315
# i=4   400-420
# i=5   500-525
# i=6   600-630
# i=7   700-735
# i=8   800-840
# i=9   900-945
# ...
# i=19 1900-1995
# i=20以降は常に1

i = x // 100

if 100*i <= x <= 105*i:
  print(1)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
import sys

x = int(input())

if x >= 2000:
    print(1)
    sys.exit()

for i in range(0,int(x/100)):
    if 100*i <= x <= 105*i:
        break

for a in range (0,i):
    for b in range (0,i):
        for c in range (0,i):
            for d in range (0,i):
                for e in range (0,i):
                    for f in range (0,i):
                        total = 100*a + 101*b + 102*c + 103*d + 104*e + 105*f
                        if total == x:
                            print(1)
                            sys.exit()

print(0)
Problem p02909 (python)

Fixed submission:
s = input()
 
if s == 'Sunny':
    print('Cloudy')
elif s == 'Cloudy':
    print('Rainy')
else:
    print('Sunny')

Buggy submission (verdict: Runtime Error):
import math

n, m = [int(x) for x in input().split()]
a = list(map(int, input().split()))

a = sorted(a, reverse=True)

for i in range(m):
    a[0] = math.floor(a[0] / 2)
    if a[0] < a[1]:
        a = sorted(a, reverse=True)

print(sum(a))

Buggy submission (verdict: Runtime Error):
n, k, q = map(int, input().split())
a = [input() for i in range(q)]

p = [k - q] * n

for i in range(q):
    p[int(a[i]) - 1] += 1

for i in range(n):
    if p[i] > 0:
        print("Yes")
    else:
        print("No")
Problem p02981 (python)

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

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

if n * a > b:
  print(b)
elif:
   print(n * a)
Problem p02993 (python)

Fixed submission:
s = input()

flg = 0

for i in range(3):
    if s[i] == s[i + 1]:
        flg = 1

if flg == 1:
    print("Bad")
else:
    print("Good")

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

s[0]s = input()

flg = 0

for i in range(3):
    if s[i] == s[i + 1]:
        flg = 1

if flg == 1:
    print("Bad")
else:
    print("Good")
Problem p02995 (python)

Fixed submission:
from fractions import gcd

a, b, c, d = map(int, input().split())
g = int(c * d / gcd(c, d))
print((b - b // c - b // d + b // g) - ((a-1) - (a-1) // c - (a-1) // d + (a-1) // g))

Buggy submission (verdict: Runtime Error):
import math

a, b, c, d = map(int, input().split())
g = int(c * d / math.gcd(c, d))
print((b - b // c - b // d + b // g) - ((a-1) - (a-1) // c - (a-1) // d + (a-1) // g))

Buggy submission (verdict: Runtime Error):
import math

a, b, c, d = map(int, input().split())

g = int(c * d / math.gcd(c, d))

b_c = b // c
b_d = b // d
b_g = b // g
a_c = (a-1) // c
a_d = (a-1) // d
a_g = (a-1) // g

ans = (b - b_c - b_d + b_g) - ((a-1) - a_c - a_d + a_g)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

a, b, c, d = map(int, read().split())

g = int(c * d / math.gcd(c, d))

b_c = b // c
b_d = b // d
b_g = b // g
a_c = (a-1) // c
a_d = (a-1) // d
a_g = (a-1) // g

ans = (b - b_c - b_d + b_g) - ((a-1) - a_c - a_d + a_g)
print(ans)
Problem p02999 (python)

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

if x < a:
    print("0")
elif x >= a:
    print("10")

Buggy submission (verdict: Runtime Error):
w, h, x, y = map(int, input().split())

if (x == w // 2 and y == h // 2) and w % 2 == 0 and h % 2 == 0:
    print(w * h / 2, 1)
else:
    print(w * h / 2, 0)
Problem p03281 (python)

Fixed submission:
n = int(input())

a = [0] * 100
b = [0] * 100
ans = 0

for i in range(100):
    a[i] = 2 * i + 1

for i in range(100):
    for j in range(2, 200):
        if a[i] % j == 0:
            b[i] += 1

for k in range(100):
    if b[k] == 7 and a[k] <= n:
        ans += 1

print(ans)

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

a = [0] * 100
b = [0] * 100
ans = 0

for i in range(100):
    a[i] = 2 * i + 1

for i in range(100):
    for j in range(2, 200):
        if a[i] % j == 0:
            b[i] += 1

for k in range(n+1):
    if b[k] == 7:
        ans += 1

print(ans)
Problem p03407 (python)

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

if a + b >= c:
    print("Yes")
else:
    print("No")

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

if a + b > c:
	Print("Yes")
Else:
	Print("No")
Problem p02664 (python)

Fixed submission:
t = input()
ans = []
for i, s in enumerate(t):
    if s == '?':
        ans.append('D')
    else:
        ans.append(s)

for s in ans:
    print(s, end='')
print('')

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

ans = []
for i, s in enumerate(t):
    if s == '?':
        if ans[i-1] == 'P':
            ans.append('D')
        else:
            ans.append('P')
    else:
        ans.append(s)

for s in ans:
    print(s, end='')
print('')

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

ans = []
for i, s in enumerate(t):
    if s == '?':
        if ans[i-1] == 'P':
            ans.append('D')
        else:
            ans.append('P')
    else:
        ans.append(s)

for s in ans:
    print(s, end='')
    print('')
Problem p02658 (python)

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

q = 1000000000000000000
b = 1
cek = True
zero = a.count(0)
if zero > 0 :
	print("0")
else :
	for i in range(n) :
		b = b*a[i]
		if b > q :
			cek = False
			break
	if cek :
		print(b)
	else :
		print("-1")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
n = int(input())
q = 1000000000000000000
b = 1
cek = True
a = list(map(int, input().split()))
for i in range(n):
	b = b * a[i] 
	if b > q :
		cek = False
		break
if cek :
	print(b)
else :
	print("-1")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
n = int(input())
q = 1000000000000000000
b = 1
cek = True
a = list(map(int, input().split()))
for i in range n :
	b = b * a[i] 
	if b > q :
		cek = False
		break
if cek :
	print(b)
else :
	print("-1")
Problem p02694 (python)

Fixed submission:
x = int(input())
p = 100
ans = 0
while(p<x) :
	p += p//100
	ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
b = 100
x = int(input())
while(b<x) :
  b += b//100
  ans += 1
print(ans)
Problem p03210 (python)

Fixed submission:
print("YES" if (int(input()) in (3,5,7)) else "NO")

Buggy submission (verdict: Runtime Error):
rint("YES" if (input() in (3,5,7)) else "NO")
Problem p03238 (python)

Fixed submission:
x=int(input())
if(x==1):
  print("Hello World")
else:
  x=int(input())
  y=int(input())
  print(x+y)

Buggy submission (verdict: Runtime Error):
xx=int(input())
if(x==1):
  print("Hello World")
else:
  x=int(input())
  y=int(input())
  print(x+y)
Problem p02558 (python)

Fixed submission:
import sys
def input(itr=iter(sys.stdin.readlines())):  # pylint: disable= redefined-builtin
    return next(itr).rstrip('\n\r')
###############################################################################

from networkx.utils.union_find import UnionFind

N, Q = map(int, input().split())

uf = UnionFind()
responses = []
for _ in range(Q):
    uq, u, v = map(int, input().split())
    if uq == 0:
        uf.union(u, v)
    else:
        responses.append(1 if uf[u] == uf[v] else 0)

print(*responses, sep='\n')

Buggy submission (verdict: Runtime Error):
import sys
def input(itr=iter(sys.stdin.readlines())):  # pylint: disable= redefined-builtin
    return next(itr).rstrip('\n\r')
###############################################################################

from networkx.utils.union_find import UnionFind

N, Q = map(int, input().split())

uf = UnionFind()
responses = []
for _ in range(Q):
    uq, u, v = map(int, input().split())
    if uq == 0:
        uf.union(u, v)
    else:
        responses.append(1 if uf[u] == uf[v] else 0)

print(*responses, sep='\n')
Problem p02621 (python)

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

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
print(sum(s != t for s, t in zip(S, T)))