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

Fixed submission:
n, m = map(int, input().split())
l = 1
r = n
for i in range(m):
  li, ri = map(int, input().split())
  l = max(l, li)
  r = min(r, ri)
print(max(r - l + 1, 0))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
l = 1
r = n
for i in range(m):
  li, ri = map(int, input().split())
  l = max(l, li)
  r = min(r, ri)
print(max(l - r + 1), 0)
Problem p03044 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

n = int(input())
d = {}
for i in range(n - 1):
  u, v, w = map(int, input().split())
  u -= 1
  v -= 1
  if u in d:
    d[u].append([v, w])
  else:
    d[u] = [[v, w]]
  if v in d:
    d[v].append([u, w])
  else:
    d[v] = [[u, w]]

rem = {}

for i in range(n):
  rem[i] = 1
  
ans = [0 for _ in range(n)]

def check(p, tmp):
  rem.pop(p)
  for n, w in d[p]:
    if n in rem:
      ntmp = (tmp + w) % 2
      ans[n] = ntmp
      check(n, ntmp)
      
check(0, 0)

for res in ans:
  print(res)

Buggy submission (verdict: Runtime Error):
n = int(input())
d = {}
for i in range(n - 1):
  u, v, w = map(int, input().split())
  u -= 1
  v -= 1
  if u in d:
    d[u].append([v, w])
  else:
    d[u] = [[v, w]]
  if v in d:
    d[v].append([u, w])
  else:
    d[v] = [[u, w]]

rem = {}

for i in range(n):
  rem[i] = 1
  
ans = [0 for _ in range(n)]

def check(p, tmp):
  rem.pop(p)
  for n, w in d[p]:
    if n in rem:
      ntmp = (tmp + w) % 2
      ans[n] = ntmp
      check(n, ntmp)
      
check(0, 0)

for res in ans:
  print(res)

Buggy submission (verdict: Runtime Error):
n = int(input())
d = {}
for i in range(n - 1):
  u, v, w = map(int, input().split())
  u -= 1
  v -= 1
  if u in d:
    d[u].append([v, w])
  else:
    d[u] = [[v, w]]
  if v in d:
    d[v].append([u, w])
  else:
    d[v] = [[u, w]]

rem = {}

for i in range(n):
  rem[i] = 1
  
ans = [0 for _ in range(n)]

def check(p, tmp):
  rem.pop(p)
  for n, w in d[p]:
    if n in rem:
      tmp = (tmp + w) % 2
      ans[n] = tmp
      check(n, tmp)
      
check(0, 0)

for res in ans:
  print(res)

Buggy submission (verdict: Runtime Error):
n = int(input())
d = {}
for i in range(n - 1):
  u, v, w = map(int, input().split())
  u -= 1
  v -= 1
  if u in d:
    d[u].append([v, w])
  else:
    d[u] = [[v, w]]
  if v in d:
    d[v] = [[u, w]]
  else:
    d[v] = [[u, w]]

rem = {}

for i in range(n):
  rem[i] = 1
  
ans = [0 for _ in range(n)]

def check(p, tmp):
  rem.pop(p)
  for n, w in d[p]:
    if n in rem:
      tmp = (tmp + w) % 2
      ans[n] = tmp
      check(n, tmp)
      
check(0, 0)

for res in ans:
  print(res)

Buggy submission (verdict: Runtime Error):
n = int(input())
d = {}
for i in range(n - 1):
  u, v, w = map(int, input().split())
  if u in d:
    d[u].append([v, w])
  else:
    d[u] = [[v, w]]
  if v in d:
    d[v].append([u, w])
  else:
    d[v] = [[u, w]]

start = list(d.keys())[0]
ans = [0 for _ in range(n)]

def walk(poj):
  ans[poj - 1] = 1
  for i, way in enumerate(d[poj]):
    if way[1] % 2 == 0:
      d[poj][i][1] = 1
      walk(way[0])
      
walk(start)
      
for res in ans:
  print(res)
Problem p03087 (python)

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

dp = [0 for column in range(n)]

for j in range(1, n):
    if s[j-1] == 'A' and s[j] == 'C':
        dp[j] = dp[j-1] + 1
    else:
        dp[j] = dp[j-1]

for _ in range(q):
    i, j =  map(int, input().split())
    print(dp[j-1] - dp[i-1])

Buggy submission (verdict: Runtime Error):
n, q = map(input().split())
s = input()
for _ in range(q):
  l, r = map(input().split())
  print(s[l:r].count('AC'))
Problem p03088 (python)

Fixed submission:
from collections import defaultdict
n = int(input())
cs = 'ATGC'
ng = [
  'AGC',
  'GAC',
  'ACG',
  'AGGC',
  'ATGC',
  'ACGC',
  'AGAC',
  'AGTC'
]

mod = 10**9 + 7
d = defaultdict(int)
for c1 in cs:
  for c2 in cs:
    for c3 in cs:
      s = c1 + c2 + c3
      if s not in ng:
        d[s] += 1
for i in range(3, n):
  nd = defaultdict(int)
  for key in d.keys():
    for c in cs:
      cn = key[1:3] + c
      cn4 = key + c
      if cn not in ng and cn4 not in ng:
        nd[cn] = (nd[cn] + d[key]) % mod
  d = nd
print(sum([d[key] for key in d]) % mod)

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
n = int(input())
cs = 'ATGC'
ng = [
  'AGC',
  'GAC',
  'ACG'
]
mod = 10**9 + 7
d = defaultdict(int)
for c1 in cs:
  for c2 in cs:
    for c3 in cs:
      s = c1 + c2 + c3
      if s not in ng:
        d[s] += 1
for i in range(3, n):
  nd = defaultdict(int)
  for key in d.keys:
    for c in cs:
      cn = key[1:2] + c
      if cn not in ng:
        nd[cn] = (nd[cn] + d[key]) % mod
  d = nd
print(sum([d[key] for key in d]) % mod)
Problem p03103 (python)

Fixed submission:
n, m = map(int, input().split())
a = []
for _ in range(n):
    a.append(list(map(int, input().split())))
a.sort()
pm = s = 0
for item in a:
    if pm + item[1] >= m:
        print(s + item[0] * (m - pm))
        break
    else:
        pm += item[1]
        s += item[0] * item[1]

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(n)].sort()
pm = s = 0
m_minus_1 = m - 1
for item in a:
    pm += item[1]
    if pm > m_minus_1:
        print(s + item[0] * (m - pm + item[1]))
        break
    else:
        s += item[0] * item[1]

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = []
for _ in range(n):
    a.append(list(map(int, input().split())))
a.sort()
pm = s = 0
m_minus_1 = m - 1
for item in a:
    pm += item[1]
    if tmp > m_minus_1:
        print(s + item[0] * (m - pm + item[1]))
        break
    else:
        s += item[0] * item[1]

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = []
for _ in range(n):
    a.append(list(map(int, input().split())))
a.sort()
pm = s = 0
m_minus_1 = m - 1
for item in a:
    pm += item[1]
    if tmp > m_minus_1:
        print(s + item[0] * (m - pm + item[1]))
        break
    else:
        s += item[0] * item[1]
Problem p03145 (python)

Fixed submission:
hs = list(map(int, input().split()))
hs.sort()
print(hs[0] * hs[1] // 2)

Buggy submission (verdict: Runtime Error):
hs = map(int, input().split())
hs.sort()
print(hs[0] * hs[1] // 2)
Problem p03211 (python)

Fixed submission:
s = [int(x) for x in list(input())]
cand = []
for c1, c2, c3 in zip(s, s[1:], s[2:]):
  res = abs(c1 * 100 + c2 * 10 + c3 - 753)
  cand.append(res)
print(min(cand))

Buggy submission (verdict: Runtime Error):
s = [int(x) for in list(input())]
cand = []
for c1, c2, c3 in zip(s, s[1:], s[2:]):
  res = abs(c1 * 100 + c2 * 10 + c3 - 753)
  cand.append(res)
print(min(cand))

Buggy submission (verdict: Runtime Error):
s = [int(x) for in list(input())]
cand = []
for c1, c2, c3 in zip(s, s[1:], s[2:]):
  res = abs(c1 * 100 + c2 * 10 + c3 - 754)
  cand.append(res)
print(min(cand))
Problem p03260 (python)

Fixed submission:
a, b = map(int, input().split())
if a * b % 2:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a, b = map(int, input())
if a * b % 2:
  print('Yes')
else:
  print('No')
Problem p03261 (python)

Fixed submission:
n = int(input())
p = ''
d = {}
for _ in range(n):
  w = input()
  if p and p[-1] != w[0]:
    print('No')
    exit()
  if w in d:
    print('No')
    exit()
  p = w[-1]
  d[w] = 1
print('Yes')

Buggy submission (verdict: Runtime Error):
n = int(input())
p = ''
d = []
for _ in range(n):
  w = input()
  if p and p[-1] == w[0]
    print('No')
    exit()
  if w in d:
    print('No')
    exit()
  p = w[-1]
  d[w] = 1
print('Yes')
Problem p03263 (python)

Fixed submission:
h, w = map(int, input().split())
a = []
m = []
ans = []
for _ in range(h):
    a.append(list(map(int, input().split())))
for j in range(h):
    f = 0
    for i in range(w):
        if not f:
            if a[j][i] % 2:
                f = a[j][i]
        else:
            ans.append([j+1, i, j+1, i+1])
            if a[j][i] % 2:
                f = 0
    m.append(f)

f = 0
for j in range(h):
    if not f:
        if m[j] % 2:
            f = m[j]
    else:
        ans.append([j, w, j+1, w])
        if m[j] % 2:
            f = 0

print(len(ans))
for ansi in ans:
    print(" ".join([str(x) for x in ansi]))

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
a = []
m = []
for _ in range(h):
    a.append(list(map(int, input().split())))
for j in range(h):
    f = 0
    for i in range(w):
        if not f:
            if a[j][i] % 2:
                f = a[i][j]
        else:
            print(j+1, i, j+1, i+1)
            if a[j][i] % 2:
                f = 0
    m.append(f)

for j in m:
    f = 0
    if not f:
        if m[j] % 2:
            f = m[j]
    else:
        print(w, j, w, j+1)
        if m[j] % 2:
            f = 0
Problem p03284 (python)

Fixed submission:
n, k = map(int, input().split())
if n % k:
  print(1)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input.split())
if n % k:
  print(1)
else:
  print(0)
Problem p03285 (python)

Fixed submission:
import sys
n = int(input())
for i in range(26):
  if (n - 4 * i ) % 7 or n - 4 * i < 0:
    continue
  else:
    print("Yes")
    sys.exit()
print("No")

Buggy submission (verdict: Runtime Error):
import sys
n = int(input())
for i in range(26):
  if (n - 4 * i ) % 7 or n - 4 * a >= 0:
    continue
  else:
    print("Yes")
    sys.exit()
print("No")

Buggy submission (verdict: Runtime Error):
import sys
n = int(input())
for i in range(26):
  if (n - 4 * i ) % 7 or n-4*a>=0:
    continue
  else:
    print("Yes")
    sys.exit()
print("No")
Problem p03290 (python)

Fixed submission:
import sys
input = sys.stdin.readline
d, g = map(int, input().split())
pc = []
for i in range(d):
    p, c = map(int, input().split())
    pc.append([p, c // 100])
g = g // 100
ans = 1000
for i in range(2 ** d):
    rem = g
    cost = 0
    for j in reversed(range(d)):
        if ((i >> j) & 1):
            p, c = pc[j]
            rem -= c + p * (j + 1)
            cost += p
    for j in reversed(range(d)):
        if  not ((i >> j) & 1):
            p, c = pc[j]
            p -= 1
            if rem >= p * (j + 1):
                rem -= p * (j + 1)
                cost += p
            else:
                while rem > 0:
                    rem -= j +1
                    cost += 1
                break
    if rem <= 0:
        ans = min(cost, ans)
print(ans)

Buggy submission (verdict: Runtime Error):
d, g = map(int, input().split())
g = g // 100
tmp = 0
cands = []
for i in range(1, d + 1):
  p, c = map(int, input().split())
  cand = [i for _ in range(p)]
  cand[-1] += c
  tmp += sum(cands)
  cands.append(cand)
  
while True:
  if tmp <= g:
    print(sum([len(cand) for cand in cands]))
    break
  lasts = [cand[-1] for cand in cands]
  index = lasts.index(min(lasts))
  tmp -= lasts[index]
  cands[index] = cands[index][:-1]
Problem p03292 (python)

Fixed submission:
a = list(map(int, input().split()))
print(
    min(
    [abs(a[0]-a[1])+abs(a[1]-a[2]), abs(a[0]-a[2])+abs(a[1]-a[0]), abs(a[0]-a[2])+abs(a[1]-a[2])]
    )
)

Buggy submission (verdict: Runtime Error):
a = list(map(int, input().split()))
print(min([abs(a[0]-a[1])+abs(a[1]-a[2]), abs(a[0]-a[2])+abs(a[1]-a[0])), abs(a[0]-a[2])+abs(a[1]-a[2])]))

Buggy submission (verdict: Runtime Error):
a = list(map(int, input().split()))
print(min(abs(a[0]-a[1])+abs(a[1]-a[2]), abs(a[0]-a[2])+abs(a[1]-a[0])), abs(a[0]-a[2])+abs(a[1]-a[2])))
Problem p03304 (python)

Fixed submission:
n, m, d = map(int, input().split())
c = n
if d:
  c = 2 * (n - d)
print(c * (m -1)/ n ** 2)

Buggy submission (verdict: Runtime Error):
n, m, d = map(int, input().split())
print((n - d) * 2 * (1 - n) ** m / (1 - n) / n ** m)
Problem p03323 (python)

Fixed submission:
a,b=map(int,input().split())
if a < 9 and b < 9:
  print('Yay!')
else:
  print(':(')

Buggy submission (verdict: Runtime Error):
a,b=map(int,input())
if a < 9 and b < 9:
  print('Yay!')
else:
  print(':(')
Problem p03330 (python)

Fixed submission:
import itertools

N, C = map(int, input().split())
d = [list(map(int, input().split())) for _ in range(C)]
c = [list(map(int, input().split())) for _ in range(N)]

memo = [[0 for i in range(C)]for j in range(3)]

for i in range(N):
    for j in range(N):
        cij = c[i][j]
        a = (i + j + 2) % 3
        for k in range(C):
            memo[a][k] += d[cij-1][k]

ans = float('inf')

for c1, c2, c3 in itertools.permutations(range(C), 3):
    ans = min(ans, memo[0][c1] + memo[1][c2] + memo[2][c3])

print(ans)

Buggy submission (verdict: Runtime Error):
import itertools

N, C = map(int, input().split())
d = [list(map(int, input().split())) for _ in range(C)]
c = [list(map(int, input().split())) for _ in range(N)]

memo = [[0 for i in range(C)]for j in range(3)]

for i in range(N):
    for j in range(N):
        cij = c[i][j]
        a = (i + j + 2) % 3
        for k in range(C):
            memo[a][k] += d[cij-1][k]

ans = 25000000


for c1, c2, c3 in itertools.permutations(range(C), 3):
    ans = min(ans, memo[c1][0] + memo[c2][1] + memo[c3][2])

print(ans)

Buggy submission (verdict: Runtime Error):
import itertools

N, C = map(int, input().split())
d = [list(map(int, input().split())) for _ in range(C)]
c = [list(map(int, input().split())) for _ in range(N)]

memo = [[0 for i in range(C)]for j in range(3)]

for i in range(N):
    for j in range(N):
        cij = c[i][j]
        a = (i + j + 2) % 3
        for k in range(C):
            memo[a][k] += d[cij-1][k]

ans = 25000000


for c1, c2, c3 in itertools.permutations(range(C), 3):
    ans = min(ans, memo[c1][0] + memo[c2][1] + memo[c3][2])

print(ans)
Problem p03360 (python)

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

a.sort()
a[-1] *= 2 ** k

print(sum(a))

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

a.sort()
a[-1] *= 2 ** k

print(sum(a))
Problem p03377 (python)

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

Buggy submission (verdict: Runtime Error):
a, b, x = map(int. input().split())
if a <= x and x <= a + b:
  print("YES")
else:
  print("NO")
Problem p03387 (python)

Fixed submission:
s = list(map(int, input().split()))
s.sort()
d1 = s[2] - s[0]
d2 = s[2] - s[1]
ans = d1 // 2 + d2 // 2
y = d1 % 2 + d2 % 2
if y == 1:
  ans += 2
if y == 2:
  ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
x = list(map(int, input().split()))
x.sort()
d1 = s[2] - s[0]
d2 = s[1] - s[0]
ans += d1 // 2 + d2 // 2
y = d1 % 2 + d2 % 2
if y == 1:
  ans += 2
if y == 2:
  ans += 1
print(ans)
Problem p03417 (python)

Fixed submission:
n, m = map(int, input().split())
if n == 1:
    n += 2
if m == 1:
    m += 2
print((n-2) *(m-2))

Buggy submission (verdict: Runtime Error):
n, m = get(int, input().split())
print(n * m - min(2, n) * min(2, m))
Problem p03435 (python)

Fixed submission:
c = []
for i in range(3):
  r = list(map(int, input().split()))
  c.append(r)
  
d1 = set([])
d2 = set([])
d3 = set([])
d4 = set([])
for i in range(3):
  d1.add(c[i][1] - c[i][0])
  d2.add(c[i][2] - c[i][1])
  d3.add(c[1][i] - c[0][i])
  d4.add(c[2][i] - c[1][i])
if len(d1) == 1 and len(d2) == 1 and len(d3) == 1 and len(d4) == 1:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
c = []
for i in range(3):
  r = map(int, input().split())
  c.append(r)
  
d1 = set([])
d2 = set([])
d3 = set([])
d4 = set([])
for i in range(3):
  d1.append(c[i][1] - c[i][0])
  d2.append(c[i][2] - c[i][1])
  d3.append(c[1][i] - c[0][i])
  d4.append(c[2][i] - c[1][i])
if len(d1) == 1 and len(d2) == 1 and len(d3) == 1 and len(d4) == 1:
  print('Yes')
else:
  print('No')
Problem p03496 (python)

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

m = 0
im = 0
for i, ai in enumerate(a):
  if abs(ai) >= abs(m):
    m = ai
    im = i
print(2*n-1)

for i in range(n):
  print(im+1, i+1)

if m > 0:
  for i in range(0, n-1):
    print(i+1, i+2)
else:
  for i in reversed(range(1, n)):
    print(i+1, i)

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

m = 0
im = 0
for i, ai in enumerate(a):
  if abs(ai) >= abs(m):
    m = ai
    im = i
print(2*n)

for i in range(n):
  print(im+1, i+1)

if im > 0:
  for i in range(0, n-1):
    print(i+1, i+2)
else:
  for i in reversed(1, n):
    print(i+1, i)
Problem p03503 (python)

Fixed submission:
import sys
input = sys.stdin.readline
n = int(input())
f = []
for i in range(n):
  f.append(list(map(int, input().split())))
p = []
for i in range(n):
  p.append(list(map(int, input().split())))

cand = []
for i in range(1, 2 ** 10):
  cnt = [0] * n
  for j in range(10):
    if i & (1 << j):
      for k in range(n):
        if f[k][j]:
          cnt[k] += 1
  v = 0
  for k in range(n):
    v += p[k][cnt[k]]
  cand.append(v)
    
print(max(cand))

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
n = int(input())
f = []
for i in range(n):
  f.append(list(map(int, input().split())))
p = []
for i in range(n):
  p.append(list(map(int, input().split())))

cand = []
for i in range(1, 2 ** 20):
  for j in range(20):
    cnt = [0] * n
    if i & (1 << j):
      for k in range(n):
        if f[k][j]:
          cnt[k] += 1
    v = 0
    for k in range(n):
      v += p[k][cnt[k]]
    cand.append(v)
    
print(max(cand))
Problem p03565 (python)

Fixed submission:
s = input()
t = input()
def check(a, b):
  if a == '?':
    return True
  else:
    return a == b
  
cand = []
for i in range(len(s)-len(t)+1):
  flag = True
  c = list(s)
  for j in range(len(t)):
    if not check(s[i+j], t[j]):
      flag = False
      break
    c[i+j] = t[j]
  if flag:
    cs = ''.join(c)
    cand.append(cs.replace('?', 'a'))
if len(cand):
  cand.sort()
  print(cand[0])
else:
  print("UNRESTORABLE")

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
def check(a, b):
  if a == '?':
    return True
  else:
    return a == b
  
cand = []
for i in range(len(s)-len(t)+1):
  flag = True
  c = list(s)
  for j in range(len(t)):
    if not check(s[i+j], t[j]):
      flag = False
      break
    c[i+j] = t[j]
  if flag:
    cs = ''.join(c)
    cand(cs.replace('?', 'a'))
if len(cand):
  cand.sort()
  print(cand[0])
else:
  print("UNRESTORABLE")

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
def check(a, b):
  if a == '?':
    return True
  else:
    return a == b
  
cand = []
for i in range(len(s)-len(t)+1):
  flag = True
  c = list(s)
  for j in range(len(t)):
    if not check(s[i+j], t[j]):
      flag = False
      break
    c[i+j] = t[j]
  if flag:
    s = ''.join(c)
    cand(s.replace('?', 'a'))
if len(cand):
  cand.sort()
  print(cand[0])
else:
  print("UNRESTORABLE")
Problem p03593 (python)

Fixed submission:
h, w = map(int, input().split())
d = {}
for i in range(h):
  for c in input():
    if c in d:
      d[c] += 1
    else:
      d[c] = 1
m = ((w + 1)// 2) * ((h + 1) // 2)
ans = "Yes"
if len(d.keys()) > m:
  ans = "No"
oc = 0
fc = 0
for key in d:
  oc += d[key] % 2
  fc += d[key] // 4
if oc > 1 or fc < (w//2) * (h//2):
  ans = "No"
print(ans)

Buggy submission (verdict: Runtime Error):
h, w = map(int. input().split())
d = {}
for i in h:
  for c in input():
    if c in d:
      d[c] += 1
    else:
      d[c] = 1
m = ((w + 1)// 2) * ((h + 1) // 2)
ans = "Yes"
if len(d.keys()) > m:
  ans = "No"
oc = 0
for key in d:
  oc += d[key] % 2
if oc > 1:
  ans = "No"
print(ans)
Problem p03599 (python)

Fixed submission:
from bisect import bisect_left
a, b, c, d, e, f = map(int, input().split())
mw = []
for i in range(31):
    for j in range(31):
        mw.append(a * i + b * j)
mw.sort()

ms = []
for i in range(3001):
    for j in range(3001):
        ms.append(- (c * i + d * j))

ms.sort()

ans = 0
ans_mw = mw[1]
ans_ms = 0

for mwi in mw[1:]:
    if mwi * 100 > f:
        break
    target = min(f - mwi * 100, mwi * e)
    msi = -ms[bisect_left(ms, - target)]
    cand = msi / mwi
    if mwi * 100 + msi <= f and cand > ans:
        ans = cand
        ans_mw = mwi
        ans_ms = msi

print(ans_mw * 100 + ans_ms, ans_ms)

Buggy submission (verdict: Runtime Error):
a, b, c, d, e, f = map(int, input().split())
ans = [0, 0, 0]
for i in range(a+b+2):
  for j in range(1,c+d+2):
    if i + 100 * j > f:
      continue:
    if i > j * e:
      continue
    cand = i / 100 / j
    if cand > ans[0]:
      ans[0] = cand
      ans[1] = i + 100 * j
      ans[2] = i
print(ans[1], ans[2])
Problem p03633 (python)

Fixed submission:
n = int(input())
def gcd(a, b):
  if not b:
    return a
  else:
    return gcd(b, a % b)
def lcm(a, b):
  return a * b // gcd(a, b)
ans = 1
for _ in range(n):
  c = int(input())
  ans = lcm(ans, c)
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
def gcd(a, b):
  if not b:
    return a
  else:
    return gcd(b, a % b)
def lcm(a, b):
  return a * b / gcd(a, b)
ans = 1
for _ in range(n):
  c = int(input())
  ans = lcm(ans, c)
print(ans)
Problem p03637 (python)

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

n2 = 0
n4 = 0

for ai in a:
  if ai % 4 == 2:
    n2 += 1
  if ai % 4 == 0:
    n4 += 1

if n2 == 0 and n4:
  n2 += 1
if n2 + n4 * 2 >= n:
  print('Yes')
else:
  print('No')

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

n2 = 0
n4 = 0

for ai in a:
  if ai % 4 == 2:
    n2 += 1
  if ai % 4 == 0:
    n4 += 1

if not n2 and n4:
  n2 += l
if n2 + n4 * 2 >= n:
  print('Yes')
else:
  print('No')
Problem p03673 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
odd = a[::2]
even = a[1::2]
even.reverse()
ans = even + odd
if n % 2:
  ans.reverse()
  
print(" ".join(list(map(str, ans))))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
odd = a[::2]
even = a[1::2]
even.reverse()
ans = even + odd
print(" ".join(ans))