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

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = []
b.append(a[0])
for mid in range(1, len(a)):
  b.append(b[mid - 1] + a[mid])
ans = 10**9

# 累積和から閉区間の合計を求める
def g_sum(l, r):
  if r < l:
    return 0
  res = b[r]
  if l != 0:
    res -= b[l-1]
  return res

lef = 1
rit = 2
for mid in range(2, n - 1):
  # 左
  while abs(g_sum(0, lef - 1) - g_sum(lef, mid - 1)) > abs(g_sum(0, lef) - g_sum(lef + 1, mid - 1)):
    lef += 1
  # 右
  while abs(g_sum(mid, rit - 1) - g_sum(rit, n - 1)) > abs(g_sum(mid, rit) - g_sum(rit + 1, n - 1)):
    rit += 1
  # 各区間の計算
  P = g_sum(0,lef - 1)
  Q = g_sum(lef, mid - 1)
  R = g_sum(mid, rit - 1)
  S = g_sum(rit, n - 1)
  # 最小値算出
  ans = min(ans, max(P,Q,R,S) - min(P,Q,R,S))
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b = []
b.append(a[0])
for mid in range(1, len(a)):
  b.append(b[mid - 1] + a[mid])
ans = 10**9

# 累積和から閉区間の合計を求める
def g_sum(l, r):
  if r < l:
    return 0
  res = b[r]
  if l != 0:
    res -= b[l-1]
  return res

lef = 1
rit = 2
for mid in range(2, n - 1):
  # 左
  while abs(g_sum(0, lef - 1) - g_sum(lef, mid - 1)) > abs(g_sum(0, lef) - g_sum(lef, mid - 1)):
    lef += 1
  # 右
  while abs(g_sum(mid, rit - 1) - g_sum(rit, n - 1)) > abs(g_sum(mid, rit) - g_sum(rit, n - 1)):
    rit += 1
  # 各区間の計算
  P = g_sum(0,lef - 1)
  Q = g_sum(lef, mid - 1)
  R = g_sum(mid, rit - 1)
  S = g_sum(rit, n - 1)
  # 最小値算出
  ans = min(ans, max(P,Q,R,S) - min(P,Q,R,S))
print(ans)
Problem p03361 (python)

Fixed submission:
H, W = map(int, input().split())
S = [input() for i in range(H)]
dd = ((0, -1), (-1, 0), (0, 1), (1, 0))
for i in range(H):
  for j in range(W):
    if S[i][j] == '.':
      continue
    for dx, dy in dd:
      nx = j + dx
      ny = i + dy
      if 0 <= nx < W and 0 <= ny < H and S[ny][nx] == '#':
        break
    else:
      print('No')
      quit()
print('Yes')

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
S = [input() for i in range(W)]
dd = ((0, -1), (-1, 0), (0, 1), (1, 0))
for i in range(H):
  for j in range(W):
    if S[i][j] == '.':
      continue
    for dx, dy in dd:
      nx = j + dx
      ny = i + dy
      if 0 <= nx < W and 0 <= ny < H:
        if S[ny][nx] == '#':
          break
    else:
      print('No')
      quit()
print('Yes')

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
S = [input() for i in range(W)]
dd = ((0,-1),(-1,0),(0,1),(1,0))
for i in range(H):
  for j in range(W):
    if S[i][j] == '.':
      continue
    for dx,dy in dd:
      nx = j + dx
      ny = i + dy
      if 0 <= nx < W and 0 <= ny < H and S[ny][nx] == '#':
        break
    else:
      print('No')
      exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
S = [input() for i in range(W)]
dd = ((0,-1),(-1,0),(0,1),(1,0))
for i in range(H):
  for j in range(W):
    if S[i][j] == '.':
      continue
    for dx,dy in dd:
      nx = j + dx
      ny = i + dy
      if 0 <= nx < W and 0 <= ny < H and S[ny][nx] == '#':
        break
    else:
      print('No')
      quit()
print('Yes')

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
S = [input() for i in range(W)]
dd = ((0,-1),(-1,0),(0,1),(1,0))
for i in range(H):
  for j in range(W):
    if S[i][j] == '.':
      continue
    for dx,dy in dd:
      nx = j + dx
      ny = i + dy
      if 0 <= nx < W and 0 <= ny < H and S[ny][nx] == '#':
        break
    else:
      print('No')
      quit()
print('Yes')

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
S = [input() for i in range(W)]
dd = ((0,-1),(-1,0),(0,1),(1,0))
for i in range(H):
  for j in range(W):
    if S[i][j] == '.':
      continue
    for dx,dy in dd:
      nx = j + dx
      ny = i + dy
      if 0<= nx < W and 0 <= ny < H and S[ny][nx] == '#':
        break
    else:
      print('No')
      quit()
print('Yes')
Problem p03599 (python)

Fixed submission:
def concentration(water, suger):
  return 100 * suger / (water + suger)

WATER_A, WATER_B, SUGER_C, SUGER_D, MELT_PER_100, LIMIT = map(int, input().split())

WATER_A *= 100
WATER_B *= 100
# 砂糖の溶解率の上限
MELT_PERCENT_LIMIT = concentration(100, MELT_PER_100)

wa = wb = sc = sd = 0

water_set = set()
while wa * WATER_A <= LIMIT:
  while wb * WATER_B <= LIMIT:
    water = wa * WATER_A + wb * WATER_B
    if water <= LIMIT:
      water_set.add(water)
    wb += 1
  wb = 0
  wa += 1

suger_set = set()
while sc * SUGER_C <= LIMIT:
  while sd * SUGER_D <= LIMIT:
    suger = sc * SUGER_C + sd * SUGER_D
    if suger <= LIMIT:
      suger_set.add(suger)
    sd += 1
  sd = 0
  sc += 1

ans_suger_water = 0
ans_suger = 0
# 最大溶解率を保持するための変数
max_concentration = 0

for water in water_set:
  for suger in suger_set:
    # 砂糖水の量が0より大きく制限量以下以外の場合は次のループへ
    if not (0 < water + suger <= LIMIT):
      continue
    # 砂糖濃度計算
    suger_precent = concentration(water, suger)
    # 砂糖濃度が最高を更新かつ限界濃度を超えていなければ答えを更新
    if max_concentration <= suger_precent <= MELT_PERCENT_LIMIT:
      max_concentration = suger_precent
      ans_suger_water = water + suger
      ans_suger = suger

print(ans_suger_water, ans_suger)

Buggy submission (verdict: Runtime Error):
A, B, C, D, E, F = map(int, input())

waters = set()
for i in range(F + 1):
    for j in range(F + 1):
        water = 100 * A * i + 100 * B * j
        if water <= F:
            waters.add(water)
waters.remove(0)

sugars = set()
for i in range(F + 1):
    for j in range(F + 1):
        sugar = C * i + D * j
        if sugar <= F:
            sugars.add(sugar)

max_percentage = 0
max_water = 0
max_sugar = 0
limit_percentage = (100 * E) / (100 + E)

for water in waters:
    for sugar in sugars:
        percentage = (100 * sugar) / (water + sugar)
        if max_percentage < percentage <= limit_percentage and water + sugar <= F:
            max_percentage = percentage
            max_water = water
            max_sugar = sugar

print('{} {}'.format(max_water + max_sugar, max_sugar))
Problem p02677 (python)

Fixed submission:
import math
a, b, h, m = map(int, input().split())
m_rad = 6 * m
h_rad = 0.5 * 60 * h + 0.5 * m
length = math.sqrt(a*a + b*b - 2*a*b*math.cos(math.radians(abs(m_rad - h_rad))))
print('{:.20f}'.format(length))

Buggy submission (verdict: Runtime Error):
import math

a, b, h, m = [int(input()) for i in range(4)]

m_rad = 6 * m
h_rad = 0.5 * 60 * h + 0.5 * m

if abs(m_rad - h_rad) == 0:
    print(b - a)
elif abs(m_rad - h_rad) == 180:
    print(a + b)
else:
    print(math.sqrt(a*a + b*b - 2*a*b*math.cos(math.radians(abs(m_rad - h_rad)))))
Problem p02658 (python)

Fixed submission:
import sys

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

if 0 in a:
  print(0)
  sys.exit(0)

s = 1
for x in a:
  s *= x
  if s > 1000000000000000000:
    break
if s > 1000000000000000000:
  print(-1)
else:
  print(s)

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

if 0 in a:
  pirnt(0)
  sys.exit(0)

s = 1
for x in a:
  s *= x
  if s > 1000000000000000000:
    break
if s > 1000000000000000000:
  print(-1)
else:
  print(s)
Problem p02687 (python)

Fixed submission:
a = input()
if a == 'ABC':
  print('ARC')
else:
  print('ABC')

Buggy submission (verdict: Runtime Error):
a = input()
if a is 'ABC':
  print('ARC')
eles:
  print('ABC')

Buggy submission (verdict: Runtime Error):
a = input()
if a is 'ABC':
  print('ARC')
eles:
  print('ABC')
Problem p02700 (python)

Fixed submission:
a, b, c, d = list(map(int, input().split()))
while True:
  c -= b
  if c <= 0:
    print('Yes')
    break
  a -= d
  if a <= 0:
    print('No')
    break

Buggy submission (verdict: Runtime Error):
a, b, c, d = list(map(int, input().split()))
while True:
  c -= b
  if c <= 0:
    print('Yes')
    break
  a -= d
  if a <= 0:
    pinrt('No')
    break
Problem p02993 (python)

Fixed submission:
n = input()
for i in range(0, 3):
  if n[i] == n[i+1]:
    print("Bad")
    exit(0)
print("Good")

Buggy submission (verdict: Runtime Error):
n = input()
s = set()
for c in n:
  s.add(c)
if s.len() == 4:
  print("Good")
else:
  print("Bad")

Buggy submission (verdict: Runtime Error):
n = input()
s = set()
for c in n:
  s.push(c)
if s.len() == 4:
  print("Good")
else:
  print("Bad")
Problem p03001 (python)

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

center = 1 if x == w / 2 and y == h / 2 else 0

print(str(w * h / 2) + ' ' + str(center))

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

center = 1 if x == w / 2 and y == h / 2 else 0

print((w * h / 2) + ' ' + center)
Problem p03076 (python)

Fixed submission:
import itertools
costs = [int(input()) for _ in range(0, 5)]
ans = 1000000000000
for x in itertools.permutations([0, 1, 2, 3, 4]):
  c = 0
  for i in range(0, 5):
    c += costs[x[i]]
    if i != 4 and c % 10 != 0:
      c += 10 - c % 10
  ans = min(c, ans)
print(ans)

Buggy submission (verdict: Runtime Error):
import itertools
costs = [int(x) for x in input().split()]
ans = 1000000000000
for x in itertools.permutations([0, 1, 2, 3, 4]):
  c = 0
  for i in range(0, 5):
    c += costs[x[i]]
    if i != 4 and c % 10 != 0:
      c += 10 - c % 10
  ans = min(c, ans)
print(ans)

Buggy submission (verdict: Runtime Error):
import itertools
costs = [int(x) for x in input().split()]
ans = 1000000000000
for x in itertools.permutations([0, 1, 2, 3, 4]):
  c = 0
  for i in range(0, 5):
    c += costs[x[i]]
    if i != 4 && c % 10 != 0:
      c += 10 - c % 10
  ans = min(c, ans)
print(ans)
Problem p03109 (python)

Fixed submission:
y, m, d = list(map(int, input().split('/')))
if m <= 4:
  print('Heisei')
else:
  print('TBD')

Buggy submission (verdict: Runtime Error):
y, m, d = input().split('/')
if m <= 4:
  print('Heisei')
else:
  print('TBD')
Problem p03146 (python)

Fixed submission:
n = int(input())
s = set()
s.add(n)
i = 1
while True:
  i += 1
  if n % 2 == 0:
    n = n / 2
  else:
    n = 3 * n + 1
  if n in s:
    print(i)
    break
  s.add(n)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = set()
s.append(n)
i = 1
while True:
  i += 1
  if n % 2 == 0:
    n = n / 2
  else:
    n = 3 * n + 1
  if n in s:
    print(i)
  s.add(n)
Problem p03219 (python)

Fixed submission:
x, y = list(map(int, input().split()))
print(x + y // 2)

Buggy submission (verdict: Runtime Error):
x, y = list(map(int, input.split()))
print(x + y // 2)
Problem p03220 (python)

Fixed submission:
n = int(input())

t, a = list(map(int, input().split()))

h = list(map(int, input().split()))

h = list(map(lambda x: (abs(a - (t - x[1] * 0.006)), x[0]), enumerate(h)))

h.sort()

print(h[0][1] + 1)

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

t, a = list(map(int, input().split()))

h = list(map(int, input().split()))

h = list(map(lambda i, x: (t - x * 0.006, i), enumerate(h)))

h.sort()

print(h[0][1] + 1)
Problem p03238 (python)

Fixed submission:
n = int(input())

if n == 1:
  print('Hello World')
else:
  a = int(input())
  b = int(input())
  print(a + b)

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

if n == 1:
  print('Hello World')
else:
  a, b = list(map(int, input().split()))
  print(a + b)
Problem p03239 (python)

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

path = []
for _ in range(N):
  c, t = list(map(int, input().split()))
  if t <= T:
    path.append(c)
path.sort()
if len(path) > 0:
  print(path[0])
else:
  print('TLE')

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

path = []
for _ in range(N):
  c, t = list(map(int, input().split()))
  if t <= T:
    path.append(c)
sort(path)
reverse(path)
if len(path) > 0:
  print(path[0])
else:
  print(path[0])
Problem p03261 (python)

Fixed submission:
n = int(input())

words = set()
w = ''
ok = True
for i in range(n):
  nw = input()
  if nw in words:
    ok = False
    break
  words.add(w)
  if w and w[-1] != nw[0]:
    ok = False
  w = nw

if ok:
  print('Yes')
else:
  print('No')

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

words = {}
w = ''
ok = True
for i in range(n):
  nw = input()
  if nw in words:
    ok = False
    break
  words.add(w)
  if w && w[-1] != nw[0]:
    ok = False
  w = nw

if ok:
  print('Yes')
else:
  print('No')

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

words = {}
w = ''
ok = True
for i in range(n):
  nw = input()
  if nw in words:
    ok = False
    break
  words.add(w)
  if w and w[-1] != nw[0]:
    ok = False
  w = nw

if ok:
  print('Yes')
else:
  print('No')

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

words = {}
w = ''
ok = True
for i in range(n):
  nw = input()
  if nw in words:
    ok = False
    break
  words.add(w)
  if w && w[-1] != nw[0]:
    ok = False
  w = nw

if ok:
  print('Yes')
else:
  print('No')
Problem p03262 (python)

Fixed submission:
import fractions

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

d = list(map(int, input().split()))

m = abs(d[0] - x)
for di in d:
  m = fractions.gcd(m, abs(di - x))

print(m)

Buggy submission (verdict: Runtime Error):
import fractions

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

d = list(map(int, input().split()))

m = (d[0] - x).abs()
for di in d:
  m = fractions.gcd(m, (di - x).abs())

print(m)
Problem p03281 (python)

Fixed submission:
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

n = int(input())
print(len(list(filter(lambda x: len(make_divisors(x)) == 8, range(1, n + 1,2)))))

Buggy submission (verdict: Runtime Error):
import sympy

sympy.divisors(10**9)

n = int(input())
print(len(list(filter(lambda x: len(sympy.divisors(x)) == 8, range(1, n + 1,2)))))

Buggy submission (verdict: Runtime Error):
import sympy

sympy.divisors(10**9)

n = int(input())
print(len(list(filter(lambda x: len(sympy.divisors(x)) == 8, range(1, n + 1,2)))))

Buggy submission (verdict: Runtime Error):
import sympy

sympy.divisors(10**9)

n = int(input())
print(len(list(filter(lambda x: sympy.divisors(x) == 8, range(0, n + 1)))))
Problem p03289 (python)

Fixed submission:
s = input()

a = -1
c = -1
lower = 0
for i in range(len(s)):
  if s[i] == 'A':
    a = i
  if s[i] == 'C':
    c = i
  if 'a' <= s[i] <= 'z':
    lower += 1

if a == 0 and 2 <= c <= len(s) - 2 and lower == len(s) - 2:
  print('AC')
else:
  print('WA')

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

a = -1
c = -1
lower = 0
for i in range(len(s))
  if s[i] == 'A':
    a = i
  if s[i] == 'C':
    c = i
  if 'a' <= s[i] <= 'z':
    lower += 1

if a == 0 and 2 <= c <= len(s) - 2 and lower == len(s) - 2:
  print('AC')
else:
  print('WA')
Problem p03352 (python)

Fixed submission:
x = int(input())
if x <= 3:
  print(1)
else:
  a = []
  for i in range(2, x + 1):
    j = 2
    while i ** j <= x:
      a.append(i ** j)
      j += 1
  print(max(a))

Buggy submission (verdict: Runtime Error):
x = int(input())
if x <= 3:
  print(1):
else:
  a = []
  for i in range(2, x + 1):
    j = 2
    while i ** j < x:
      a.append(i ** j)
  print(max(a))
Problem p03370 (python)

Fixed submission:
n, x = list(map(int, input().split()))
m = []
for _ in range(n):
  m.append(int(input()))
m.sort()

def main():
  for i in range(n):
    if sum(m[0:i+1]) > x:
      print(i)
      return
  print(n)

if sum(m) > x:
  main()
else:
  print(n + (x - sum(m)) // m[0])

Buggy submission (verdict: Runtime Error):
n, x = list(map(int, input().split()))
m = []
for _ in range(n):
  m.append(int(input()))
sort(m)

def main():
  for i in range(n):
    if sum(m[0:i+1]) > x:
      print(i)
      return
  print(n)

main()
Problem p03377 (python)

Fixed submission:
a,b,x=list(map(int,input().split()))
if a+b >= x and a <= x:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
a,b,x=list(map(int,input()))
if a+b >= x:
  print("YES")
else:
  print("NO")
Problem p03407 (python)

Fixed submission:
a,b,c=list(map(int,input().split()))
if a+b >= c:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a,b,c=list(map(int input().split()))
if a+b >= c:
  print('Yes')
else:
  print('No')
Problem p03433 (python)

Fixed submission:
n = int(input())
a = int(input())

if n % 500 <= a:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n, a = list(map(int, input().split()))
if n % 500 <= a:
  print('Yes')
else:
  print('No')

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

if n % 500 <= a:
  print('Yes')
else:
  print('No')

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

if n % 500 <= a:
  print('Yes')
else:
  print('No')
Problem p03477 (python)

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

A = a + b
B = c + d
if A == B:
  print('Balanced')
elif A > B:
  print('Left')
elif A < B:
  print('Right')

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

A = a + b
B = c + d
if A == B:
  print('Balanced')
else if A > B:
  print('Left')
else if A < B:
  print('Right')
Problem p03495 (python)

Fixed submission:
from collections import defaultdict

n, k = list(map(int, input().split()))
a = list(map(int, input().split()))

d = defaultdict(int)
for x in a:
    d[x] += 1

av = list(sorted(d.values()))
ks = 0
idx = 0
print(sum(av[0:-k]))

Buggy submission (verdict: Runtime Error):
from collections import defaultdict

n, k = list(map(int, input().split()))
a = list(map(int, input().split()))

d = defaultdict(int)
for x in a:
  d[x] += 1

av = reverse(sorted(d.values()))
ks = 0
idx = 0
while ks < k:
  ks += av[idx]
  idx += 1
print(idx)
Problem p03609 (python)

Fixed submission:
x, t = list(map(int, input().split()))
print(max([0, x - t]))

Buggy submission (verdict: Runtime Error):
x, t = list(map(int, input().split()))
print(max([0, x - t])

Buggy submission (verdict: Runtime Error):
x, t = list(map(input().split()))
print(max([0, x - t])
Problem p03635 (python)

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

print((a - 1) * (b - 1))

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

print((a - 1) * (b - 1))
Problem p03671 (python)

Fixed submission:
print(sum(sorted(list(map(int, input().split())))[0:2]))

Buggy submission (verdict: Runtime Error):
print(sum(sorted(list(map(int, intput().split())))[0:2]))
Problem p03738 (python)

Fixed submission:
a = int(input())
b = int(input())

if a < b:
  print('LESS')
elif a > b:
  print('GREATER')
else:
  print('EQUAL')

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

if a < b:
  print('LESS'):
elif a > b:
  print('GREATER')
else:
  print('EQUAL')
Problem p03760 (python)

Fixed submission:
o = input()
e = input()
n = []
e += ' '
for i in range(len(o)):
  n.append(o[i])
  n.append(e[i])
print(''.join(n).strip())

Buggy submission (verdict: Runtime Error):
o = input()
e = input()
n = []
e.append(' ')
for i in range(o):
  n.append(o[i])
  n.append(e[i])
print(''.join(n).strip())
Problem p03777 (python)

Fixed submission:
a, b = input().split()
if a == b:
  print('H')
else:
  print('D')

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

if a == b:
  print('H'):
else:
  print('D')
Problem p03779 (python)

Fixed submission:
x = int(input())
s = 0
j = 0
for i in range(1,x+1):
  s += i
  j += 1
  if s >= x:
    print(j)
    break

Buggy submission (verdict: Runtime Error):
x = int(input())
s = 0
j = 0
for i in range(1..x+1):
  s += i
  j += 1
  if s >= x:
    print(j)
    break
Problem p03846 (python)

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


cnt = [0] * n
for x in a:
  cnt[x] += 1

ok = True
for i in range(0, n):
  if n % 2 == 1 and i % 2 == 0:
    if i == 0 and cnt[i] != 1 or i > 0 and cnt[i] != 2:
      ok = False
  elif n % 2 == 0 and i % 2 == 1:
    if cnt[i] != 2:
      ok = False

if not ok:
  print(0)
else:
  res = 1
  for i in range(0, n // 2):
    res *= 2
    res %= 1000000007
  print(res)

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

cnt = [0] * n
for x in a:
  a[x] += 1

ok = True
for i in range(0, n):
  if n % 2 == 1 && i % 2 == 0:
    if i == 0 && cnt[i] != 1 or cnt[i] != 2:
      ok = False
  elif n % 2 == 0 && i % 2 == 0:
    if cnt[i] != 2:
      ok = False

if not ok:
  print(0)
else:
  res = 1
  for i in range(0, n // 2):
    res *= 2
    res %= 1000000007
print(res)
Problem p03635 (python)

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

Buggy submission (verdict: Runtime Error):
x,y = int(input().split())
print((x-1)*(y-1))
Problem p02743 (python)

Fixed submission:
h = list(map(int, input().split()));
a = h[0]
b = h[1]
c = h[2]
if(c-a-b<=0):
  print("No")
elif(4*a*b<(c-a-b)**2):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <stdio.h>
#include <iomanip>
#include <limits>
#include <list>
#include <string>
#include <queue>
#include <deque>
#include <tuple>
#include <map>
#include <sstream>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define FOR(i,a,b) for(int i=a; i<(int)(b); i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort(ALL(x))
#define CLR(a) memset((a), 0 ,sizeof(a))
#define PB push_back
#define MP make_pair
#define SP << " " <<
const int INF = 1001001001;
const ll LINF = 100100100100100100;
const double EPS = 1e-10;
const long double PI  = acos(-1.0L);
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
#define chmax(a,b) a = (((a)<(b))?(b):(a))
#define chmin(a,b) a = (((a)>(b))?(b):(a))

__attribute__((constructor))
void initial(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

signed main(){
	ll a,b,c; cin>>a>>b>>c;
	cerr << 4*a*b SP pow(c-a-b,2) << endl;
	if(c-a-b<=0) cout<<"No";
	else if(4*a*b<pow(c-a-b,2)) cout << "Yes";
	else cout << "No";

  return 0;
}