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

Fixed submission:
def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a


def lcm(a, b):
    return a * b // gcd(a, b)


def two(val):
    ret = 0
    tmp = val
    while True:
        if tmp != 0 and tmp % 2 == 0:
            ret += 1
            tmp = tmp // 2
        else:
            break
    return ret


n, m = map(int, input().split())
a_list = list(map(int, input().split()))
b_list = []

for item in a_list:
    b_list.append(item // 2)

cnt = -1

for item in b_list:
    ret = two(item)
    if cnt == -1:
        cnt = ret
    elif cnt != ret:
        print(0)
        exit()

val = b_list[0]

for item in b_list:
    val = lcm(item, val)

ret = m // val

tmp1 = ret // 2
tmp2 = ret % 2

print(tmp1 + tmp2)

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

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

n, m = map(int, input().split())
a_str_list = input().split()

a_list = []

for item in a_str_list:
    a_list.append(int(item))

a_list = list(set(l))

step = lcm_list(a_list)
start = step // 2

if m - start < 0:
    print(0)
else:
    print(((m-start) // step)+1)

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

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

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

n, m = map(int, input().split())
a_str_list = input().split()

a_list = []

for item in a_str_list:
    a_list.append(int(item))

step = lcm_list(a_list)
start = lcm_list(a_list) // 2

if m - start < 0:
    print(0)
else:
    print(((m-start) // step)+1)

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

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

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

n, m = map(int, input().split())
a_str_list = input().split()

a_list = []

for item in a_str_list:
    a_list.append(int(item))

step = lcm_list(a_list)
start = lcm_list(a_list) // 2

if m - start < 0:
    print(0)
else:
    print(((m-start) // step)+1)
Problem p02817 (python)

Fixed submission:
s, t = input().split()
print(t+s)

Buggy submission (verdict: Runtime Error):
s, t = input.split()
print(t+s)
Problem p02838 (python)

Fixed submission:
def str2bitstr(chs):
    val = int(chs)
    tmp = bin(val)[2:]
    tmp2 = '0' * (60 - len(tmp))
    return tmp2 + tmp


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

cnts = [0] * 60

for item in a:
    for i, ch in enumerate(item):
        if ch == '1':
            cnts[i] += 1

ret = 0
now = 1

for i in range(1, 61):
    kumi = cnts[-i] * (n - cnts[-i]) % (10 ** 9 + 7)
    ret += kumi * now % (10 ** 9 + 7)
    now *= 2 % (10 ** 9 + 7)
    ret = ret % (10 ** 9 + 7)

print(ret % (10 ** 9 + 7))

Buggy submission (verdict: Runtime Error):
def str2bitstr(chs):
    val = int(chs)
    tmp = bin(val)[2:]
    tmp2 = '0' * (59 - len(tmp))
    return tmp2 + tmp


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

cnts = [0] * 59

for item in a:
    for i, ch in enumerate(item):
        if ch == '1':
            cnts[i] += 1

ret = 0
now = 1

for i in range(1, 60):
    kumi = cnts[-i] * (n - cnts[-i]) % (10 ** 9 + 7)
    ret += kumi * now % (10 ** 9 + 7)
    now *= 2

print(ret % (10 ** 9 + 7))
Problem p02885 (python)

Fixed submission:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
a, b = map(int, input().split())

print(max(0, a - 2 * b))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
from collections import defaultdict
from heapq import heappop, heappush


class Graph(object):
    """
    隣接リストによる有向グラフ
    """

    def __init__(self):
        self.graph = defaultdict(list)

    def __len__(self):
        return len(self.graph)

    def add_edge(self, src, dst, weight=1):
        self.graph[src].append((dst, weight))

    def get_nodes(self):
        return self.graph.keys()


class Dijkstra(object):
    """
    ダイクストラ法（二分ヒープ）による最短経路探索
    計算量: O((E+V)logV)
    """

    def __init__(self, graph, start):
        self.g = graph.graph

        # startノードからの最短距離
        # startノードは0, それ以外は無限大で初期化
        self.dist = defaultdict(lambda: float('inf'))
        self.dist[start] = 0

        # 最短経路での1つ前のノード
        self.prev = defaultdict(lambda: None)

        # startノードをキューに入れる
        self.Q = []
        heappush(self.Q, (self.dist[start], start))

        while self.Q:
            # 優先度（距離）が最小であるキューを取り出す
            dist_u, u = heappop(self.Q)
            if self.dist[u] < dist_u:
                continue
            for v, weight in self.g[u]:
                alt = dist_u + weight
                if self.dist[v] > alt:
                    self.dist[v] = alt
                    self.prev[v] = u
                    heappush(self.Q, (alt, v))

    def shortest_distance(self, goal):
        """
        startノードからgoalノードまでの最短距離
        """
        return self.dist[goal]

    def shortest_path(self, goal):
        """
        startノードからgoalノードまでの最短経路
        """
        path = []
        node = goal
        while node is not None:
            path.append(node)
            node = self.prev[node]
        return path[::-1]


def query(src, dst, d_list, d_dict, l):
    count = 0
    now_l = l
    d = d_list[src-1]
    distance = d.shortest_distance(dst-1)
    if distance <= l:
        print(0)
        return

    path = d.shortest_path(dst-1)

    if(len(path) == 1):
        print(-1)
        return

    now_s = path[0]

    for item in path[1:]:
        length = d_dict[str(now_s)+":"+str(item)]
        if length > l:
            print(-1)
            return
        elif length > now_l:
            count += 1
            now_l = l - length
        else:
            now_l = now_l - length
        now_s = item
    print(count)


n, m, l = map(int, input().split())
inputs = []
d_dict = dict()

for i in range(m):
    a, b, c = map(int, input().split())
    inputs.append((a-1, b-1, c))
    d_dict[str(a-1)+":"+str(b-1)] = c
    d_dict[str(b-1)+":"+str(a-1)] = c

g = Graph()
for src, dst, weight in inputs:
    g.add_edge(src, dst, weight)
    g.add_edge(dst, src, weight)

d_list = []

for i in range(n):
    d_list.append(Dijkstra(g, i))

q = int(input())

for i in range(q):
    s, t = map(int, input().split())
    query(s, t, d_list, d_dict, l)
Problem p02913 (python)

Fixed submission:
# -*- coding: utf-8 -*-
tmp = input()
my_str = input()

start = 0
end = 1
max_len = 0

while (end < len(my_str)):
    if my_str[start:end] in my_str[end:]:
        if end - start > max_len:
            max_len = end - start
        end += 1
    else:
        start += 1

print(max_len)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-                                                         
tmp = input()
my_str = input()

start = 0
end = 1
max_len = 0

while (end < len(my_str)):
    if my_str[start:end] in my_str[end:]:
        if end - start > max_len:
            max_len = end - start
     	end += 1
    else:
        start += 1

print(max_len)
Problem p02923 (python)

Fixed submission:
n = input()
h_string = input()
h_list = h_string.split(" ")
for i in range(len(h_list)):
    h_list[i] =	int(h_list[i])


longest = 0
now_value = -1
now_length = 0


for value in h_list:
    if value <= now_value:
        now_length += 1
        now_value = value
        if now_length > longest:
            longest = now_length
    else:
        if now_length > longest:
            longest = now_length
        now_value = value
        now_length = 0

print(longest)

Buggy submission (verdict: Runtime Error):
n = input()
h_string = input()
h_list = h_string.split(" ")
for item in h_list:
    item = int(item)


longest = 0
now_value = -1
now_length = 0


for value in h_list:
    if value <= now_value:
        now_length += 1
        now_value = value
        if now_length > longest:
            longest = now_length
    else:
        if now_length > longest:
            longest = now_length
        now_value = value
        now_length = 0

print(longest)
Problem p02936 (python)

Fixed submission:
from collections import deque

n, q = map(int, input().split())
rg = [[] for _ in range(n)]
for _ in range(n-1):
    a, b = map(int, input().split())
    rg[a-1].append(b-1)
    rg[b-1].append(a-1)

deq = deque()
pnt = [0] * n

for _ in range(q):
    p, x = map(int, input().split())
    pnt[p-1] += x

visited = set()

deq.append(0)
visited.add(0)

while deq:
    ptr = deq.pop()
    for item in rg[ptr]:
        if item not in visited:
            visited.add(item)
            pnt[item] += pnt[ptr]
            deq.append(item)

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

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

for i in range(n-1):
    a, b = map(int, input().split())
    a, b = a - 1, b - 1
    if a in my_dict:
        my_dict[a].append(b)
    else:
        my_dict[a] = [b]
    if b in my_dict:
        my_dict[b].append(a)
    else:
        my_dict[b] = [a]

stk = []

my_p = dict()

for i in range(q):
    p, x = map(int, input().split())
    p -= 1
    if p in my_p:
        my_p[p] += x
    else:
        my_p[p] = x

my_ret = dict()

stk = []
stk.append((0, my_p[0]))

visited = set()

while stk:
    ptr, pnt = stk.pop()
    visited.add(ptr)
    my_ret[ptr] = pnt
    for item in my_dict[ptr]:
        if item in visited:
            continue
        tmp = 0
        if item in my_p:
            tmp = my_p[item]
        stk.append((item, pnt + tmp))

ret = []

for i in range(n):
    ret.append(str(my_ret[i]))

print(' '.join(ret))

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

for i in range(n-1):
    a, b = map(int, input().split())
    a, b = a - 1, b - 1
    if a in my_dict:
        my_dict[a].append(b)
    else:
        my_dict[a] = [b]
    if b in my_dict:
        my_dict[b].append(a)
    else:
        my_dict[b] = [a]

stk = []

my_p = dict()

for i in range(q):
    p, x = map(int, input().split())
    p -= 1
    if p in my_p:
        my_p[p] += x
    else:
        my_p[p] = x

my_ret = dict()

stk = []
stk.append((0, my_p[0]))

visited = set()

while stk:
    ptr, pnt = stk.pop()
    visited.add(ptr)
    my_ret[ptr] = pnt
    for item in my_dict[ptr]:
        if item in visited:
            continue
        tmp = 0
        if item in my_p:
            tmp = my_p[item]
        stk.append((item, pnt + tmp))

ret = []

for i in range(n):
    ret.append(str(my_ret[i]))

print(' '.join(ret))
Problem p02614 (python)

Fixed submission:
import sys
from itertools import combinations
import numpy as np

rm = lambda: map(int, sys.stdin.readline().split())
rr = lambda: sys.stdin.readline().rstrip()

h, w, k = rm()
li = np.array([np.array(list(rr())) for _ in range(h)])
cnt = 0

for i in range(h+1):
    for a in np.array(list(combinations(li, i))):
        a = a.T
        for j in range(w+1):
            for b in np.array(list(combinations(a, j))):
                t = np.count_nonzero(b == '#')
                if t == k:
                    cnt += 1
print(cnt)

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

rm = lambda: map(int, sys.stdin.readline().split())

h, w, k = rm()
cnt = 0
def f(x):
  if x == '#':
    return 1
  else:
    return 0
li = np.array([np.array(list(map(f, sys.stdin.readline().split()))) for _ in range(h)])
lih = list(itertools.product(list(range(2)), repeat=h))
liw = list(itertools.product(list(range(2)), repeat=w))

for i in lih:
  a = list(itertools.compress(li, i))
  a.T()
  for j in liw:
    b = list(itertools.compress(a, j))
    if np.sum(b) == k:
      cnt += 1
print(cnt)
Problem p02630 (python)

Fixed submission:
import sys
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))

n = ri()
a = rl()
t = sum(a)
cnt_li = [0]*10**5
for i in a:
    cnt_li[i-1] += 1

for _ in range(ri()):
    b, c = rm()
    t += (c-b)*cnt_li[b-1]
    print(t)
    cnt_li[c-1] += cnt_li[b-1]
    cnt_li[b-1] = 0

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

ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))

n = ri()
a = rl()
il = list(set(a))
li = collections.Counter(a)
q = ri()
res = []
bc = [rm() for _ in range(q)]
for vvv in bc:
    b, c = vvv
    if b in il:
        if c in il:
            li[c] += li[b]
        else:
            li[c] = li[b]
            il.append(c)
        li[b] = 0
        il.remove(b)
    ans = 0
    for k, v in li.items():
        ans += k*v
    res.append(ans)
for aaa in res:
    print(aaa)

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

ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))

n = ri()
a = rl()
il = list(set(a))
li = collections.Counter(a)
q = ri()
res = []
for _ in range(q):
    b, c = rm()
    if b in il:
        if c in il:
            li[c] += li[b]
        else:
            li[c] = li[b]
            il.append(c)
        li[b] = 0
        il.remove(b)
    ans = 0
    for k, v in li.items():
        ans += k*v
    res.append(ans)
for aaa in res:
    print(aaa)

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

ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))

n = ri()
a = rl()
il = list(set(a))
li = collections.Counter(a)
q = ri()
for _ in range(q):
    b, c = rm()
    if b in il:
        if c in il:
            li[c] += li[b]
        else:
            li[c] = li[b]
            il.append(c)
        li[b] = 0
        il.remove(b)
    ans = 0
    for k, v in li.items():
        ans += k*v
    print(ans)
Problem p02641 (python)

Fixed submission:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.buffer.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

x, n = rm()
if n >= 1:
  li = rl()
else:
  print(x)
  exit()
for i in range(101):
  if (x-i) not in li:
    print(x-i)
    exit()
  elif (x + i) not in li:
    print(x+i)
    exit()

Buggy submission (verdict: Runtime Error):
import sys
import collections
import heapq

ri = lambda: int(sys.stdin.readline())
rl = lambda: list(map(int, sys.stdin.readline().split()))

def heapsort(iterable):
  h = []
  for value in iterable:
    heapq.heappush(h, value)
  l = []
  for _ in range(len(h)):
    l.append(heapq.heappop(h))
  return l

n = ri()
li = rl()
dic = collections.Counter(li)
li1 = []
li2 = []
for k, v in dic.items():
    if v > 1:
        li1.append(k)
    else:
        li2.append(k)
li1 = heapsort(li1)
li2 = heapsort(li2)
le1 = len(li1)
le2 = len(li2)
cnt = 0
for i in range(le2):
    li2i = li2[i]
    for j in range(i):
        if li2i % li2[j] == 0:
            break
    else:
        for k in range(le1):
            li1k = li1[k]
            if li1k > li2i**0.5:
                cnt += 1
                break
            if li2i % li1k == 0:
                break
        else:
            cnt += 1
print(cnt)
Problem p02646 (python)

Fixed submission:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.buffer.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

a, v = rm()
b, w = rm()
t = ri()
if v - w == 0:
  print('NO')
  exit()
if 0 <= abs(a-b) / (v-w) <= t:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.buffer.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

a, v = rm()
b, w = rm()
t = ri()
if v - w == 0:
  print('NO')
  exit()
if 0 <= (a-b) / (v-w) <= t:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.buffer.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

a, v = rm()
b, w = rm()
t = ri()
if abs(a-b) / (v-w) <= t:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.buffer.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

a, v = rm()
b, w = rm()
t = ri()
if ((b-a) / (v-w)) % t == 0:
  print('YES')
else:
  print('NO')
Problem p02678 (python)

Fixed submission:
import sys
import math
import itertools
import numpy

rl = sys.stdin.readline

n, m = map(int, rl().split())
li = [[] for _ in range(m+1)]
for _ in range(m):
  a, b = map(int, rl().split())
  a -= 1
  b -= 1
  li[a].append(b)
  li[b].append(a)

marks = [-1]*n
stack = [0]
while stack:
    for next_room in li[stack[0]]:
        if marks[next_room] == -1:
            stack.append(next_room)
            marks[next_room] = stack[0]
    del stack[0]
if -1 in marks:
  print('No')
else:
  print('Yes')
  for i in marks[1:]:
    print(i+1)

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

rl = sys.stdin.readline

n, m = map(int, rl().split())
li = [[] for _ in range(m+1)]
for _ in range(m):
  a, b = map(int, rl().split())
  a -= 1
  b -= 1
  li[a].append(b)
  li[b].append(a)

marks = [-1]*n
marks[0] = 0
def dfs(aa, x):
  marks[x] = aa
  for nr in li[x]:
    if marks[nr] == -1:
      dfs(x, nr)
  
  
dfs(0, 0)
if -1 in marks:
  print('No')
else:
  print('Yes')
  for i in marks[1:]:
    print(i+1)

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

rl = sys.stdin.readline

n, m = map(int, rl().split())
li = [[] for _ in range(m)]
for _ in range(m):
  a, b = map(int, rl().split())
  a -= 1
  b -= 1
  li[a].append(b)
  li[b].append(a)

marks = [-1]*n
marks[0] = 0
def dfs(aa, x):
  marks[x] = aa
  for nr in li[x]:
    if marks[nr] == -1:
      dfs(x, nr)
  
  
dfs(0, 0)
if -1 in marks:
  print('No')
else:
  print('Yes')
  for i in marks[1:]:
    print(i+1)

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

rl = sys.stdin.readline

n, m = map(int, rl().split())
li = [[] for _ in range(m)]
for _ in range(m):
  a, b = map(int, rl().split())
  a -= 1
  b -= 1
  li[a].append(b)
  li[b].append(a)

marks = [-1]*n
marks[0] = 0
def dfs(x):
  for nr in li[x]:
    if marks[nr] == -1:
      marks[nr] = x
      dfs(nr)
  
dfs(0)
if -1 in marks:
  print('No')
else:
  print('Yes')
  for i in marks[1:]:
    print(i+1)

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

rl = sys.stdin.readline

n, m = map(int, rl().split())
li = [[] for _ in range(m)]
for _ in range(m):
  a, b = map(int, rl().split())
  a -= 1
  b -= 1
  li[a].append(b)
  li[b].append(a)

marks = [-1]*n
stack = [0]
while stack:
    for next_room in li[stack[0]]:
        if marks[next_room] == -1:
            stack.append(next_room)
            marks[next_room] = stack[0]
    del stack[0]
if -1 in stack:
  print('No')
else:
  print('Yes')
  for i in marks[1:]:
    print(i+1)
Problem p02681 (python)

Fixed submission:
import sys
n = sys.stdin.readline().rstrip()
s = sys.stdin.readline().rstrip()
if n == s[:len(n)]:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
import sys
n = sys.stdin.readline().rstrip()
s = sys.stdin.readline().rstrip()
if n = s[:len(n)]:
  print('Yes')
else:
print('No')
Problem p02687 (python)

Fixed submission:
import sys
n = sys.stdin.readline().strip()
if n == 'ABC':
  print('ARC')
else:
  print('ABC')

Buggy submission (verdict: Runtime Error):
import sys
n = sys.stdin.readline()
if n = 'ABC':
  print('ARC')
else:
  print('ABC')
Problem p02690 (python)

Fixed submission:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7


x = ri()
for a in range(150):
    for b in range(-150, a):
        if a**5 - b**5 == x:
            print(a, b)
            exit()

Buggy submission (verdict: Runtime Error):
import sys
x = int(sys.stdin.readline())
a = 0.1
b = -10**5
while not a.is_integer():
  a = x-b**5
  a = a**0.2
  b += 1
print(int(a), b-1)

Buggy submission (verdict: Runtime Error):
import sys
x = int(sys.stdin.readline())
a = 0.1
b = 0
while not a.is_integer():
  a = x-b**5
  a = a**0.2
  b += 1
print(int(a), b-1)
Problem p02713 (python)

Fixed submission:
import sys
import math
k = int(sys.stdin.readline())
a = 1
t = 0
while a <= k:
  b = 1
  while b <= k:
    c = 1
    while c <= k:
      t += math.gcd(math.gcd(a,b), c)
      c += 1
    b += 1
  a += 1
print(t)

Buggy submission (verdict: Runtime Error):
import sys
import math
k = int(sys.stdin.readline())
a = 1
t = 0
while a <= k:
  b = 1
  while b <= k:
    c = 1
    while c <= k:
      t += math.gcd(a,b,c)
      c += 1
    b += 1
  a += 1
print(t)

Buggy submission (verdict: Runtime Error):
import sys
import math
k = int(sys.stdin.readline())
a = 1
t = 0
while a <= k:
  b = 1
  while b <= k:
    c = 1
    while c <= k:
      t += math.gcd(a,b,c)
      c += 1
    b += 1
  a += 1
print(t)

Buggy submission (verdict: Runtime Error):
import sys
import math
k = int（sys.stdin.readline())
a = 1
t = 0
while a <= k:
  b = 1
  while b <= k:
    c = 1
    while c <= k:
      t += math.gcd(a,b,c)
      c += 1
    b += 1
  a += 1
print(t)
Problem p02718 (python)

Fixed submission:
import sys
N, M = map(int, sys.stdin.readline().split())
li = list(map(int, sys.stdin.readline().split()))
li.sort(reverse=True)
if li[M-1] < sum(li)/(4*M):
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
import sys
N, M = map(int, sys.stdin.readline().split())
li = list(map(int, sys.stdin.readline().split))
li.sort(reverse=False)
if li[M-1] < sum(li)/(4*M):
  print('No')
else:
  print('Yes')
Problem p02724 (python)

Fixed submission:
import sys
X = sys.stdin.readline()
X = int(X)
score = (X//500) * 1000
X %= 500
score += (X//5) * 5
print(score)

Buggy submission (verdict: Runtime Error):
import sys
X = sys.stdin.readline()
score = X//500 * 1000
X %= 500
score += X//5 * 5
print(score)