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

Fixed submission:
import sys
input = sys.stdin.readline

inf = float('inf')

# dist[i][j]: iからjへのコスト,  n:頂点数
def warshall_floyd(dist,n):
    for k in range(n):
        for i in range(n):
            for j in range(n):
                if i == j:
                    dist[i][j] = 0
                elif dist[i][j] > dist[i][k] + dist[k][j]:
                    dist[i][j] = dist[i][k] + dist[k][j]

N,M = map(int,input().split())
edges = []
ad = [[inf]*N for _ in range(N)]
for _ in range(M):
    a,b,c = map(int,input().split())
    a -= 1;  b -= 1
    edges.append((a,b,c))
    ad[a][b] = c
    ad[b][a] = c

warshall_floyd(ad,N)
ans = M

for a,b,c in edges:
    if a > b:
        a,b = b,a
    for s in range(N):
        for e in range(s+1,N):
            if ad[s][a] + c + ad[b][e] == ad[s][e]:
                ans -= 1
                break
        else:
            continue
        break

print(ans)

Buggy submission (verdict: Runtime Error):
from collections import deque
sx,sy,tx,ty = map(int,input().split())
ans_list = []
(tx,ty) = (tx-sx,ty-sy); (sx,sy) = (0,0)
H,W = ty+3,tx+3
visited = [[0]*(tx+3) for i in range(ty+3)]
d = [[1,0],[0,1],[-1,0],[0,-1]]
(sx,sy) = (sx+1,sy+1); (tx,ty) = (tx+1,ty+1)
def bfs(si,sj,gi,gj):
    tr = [[si,sj]]
    q = deque([[si,sj,tr]])
    while q:
        i,j,tr = q.popleft()
        if (i,j) == (gi,gj):
            return tr
        for di,dj in d:
            ni = i + di; nj = j + dj
            if 0 <= ni <= H-1 and 0 <= nj <= W-1 and visited[ni][nj] == 0:
                visited[ni][nj] = 1
                ntr = tr[:]; ntr.append([ni,nj])
                q.append([ni,nj,ntr])

def change(tr):
    def func(d):
        if d == (1,0):return "U"
        if d == (-1,0):return "D"
        if d == (0,-1):return "L"
        if d == (0,1):return "R"
    for i in range(len(tr)-1):
        (ni,nj) = (tr[i+1][0],tr[i+1][1])
        (i,j) = (tr[i][0],tr[i][1])
        d = (ni-i,nj-j)
        ans_list.append(func(d))

tr = []
for cnt in range(2):
    res = bfs(sy,sx,ty,tx)
    for k in range(1,len(res)):
        i,j = res[k][0],res[k][1]
        rei, rej = ty + sx - i, tx + sy - j
        res.append([rei,rej])
    if cnt == 0:
        tr += res
    else:
        tr += res[1:]
    visited = [[0]*W for i in range(H)]
    for i,j in tr:
        visited[i][j] = 1
    visited[ty][tx] = 0

change(tr)
ans = "".join(ans_list)
print(ans)
Problem p03838 (python)

Fixed submission:
x,y = map(int,input().split())
if x == y:
    ans = 0
elif 0 <= x < y:
    ans = y - x
elif 0 <= y < x:
    if y == 0:
        ans = 1 + x 
    else:
        ans = 1 - y + x + 1
elif x < y <= 0:
    ans = y - x
elif y < x <= 0:
    if x == 0:
        ans = - y + 1
    else:
        ans = 1 - y + x + 1
elif x < y:
    if abs(x) <= abs(y):
        ans = 1 + y + x
    elif abs(x) > abs(y):
        ans = - y - x + 1
elif y < x:
    if abs(x) <= abs(y):
        ans = - y - x + 1
    elif abs(x) > abs(y):
        ans = 1 + y + x
print(ans)

Buggy submission (verdict: Runtime Error):
x,y = map(int,input().split())
if x == y:
    ans = 0
elif 0 <= x < y:
    ans = y - x
elif 0 <= y < x:
    if y == 0:
        ans = 1 + x 
    else:
        ans = 1 - y + x + 1
elif x < y <= 0:
    ans = y - x
elif y < x <= 0:
    if x == 0:
        ans = - y + 1
    else:
        ans = 1 - y + x + 1
elif x < y:
    if abs(x) < abs(y):
        ans = 1 + y + x
    elif abs(x) > abs(y):
        ans = - y - x + 1
elif y < x:
    if abs(x) < abs(y):
        ans = - y - x + 1
    elif abs(x) > abs(y):
        ans = 1 + y + x
print(ans)
Problem p03854 (python)

Fixed submission:
s = input()
str_list = ["dream","dreamer","erase","eraser"]
for i in range(len(s) // 5):
    if s[-7:] == "dreamer":
        s = s[:-7]
    elif s[-6:] == "eraser":
        s = s[:-6]
    elif s[-5:] == "dream" or s[-5:] == "erase":
        s = s[:-5]
ans = "YES" if s == "" else "NO"
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
str_list = ["eraser","erase","dreamer","dream"]
for e in str_list:
    s = s.replace(e)
ans = "YES" if s == "" else "NO"
print(ans)
Problem p03855 (python)

Fixed submission:
import sys
input = sys.stdin.readline

class Unionfind:

    __slots__ = ['nodes','size']

    def __init__(self, n):
        self.nodes = list(range(n))
        self.size = [1]*n

    def root(self, x):
        if self.nodes[x] == x:
            return x
        else:
            root_x = self.root(self.nodes[x])
            self.nodes[x] = root_x
            return root_x

    def unite(self, x, y):
        x = self.root(x); y = self.root(y)
        if x == y:
            return
        if self.size[x] < self.size[y]:
            x, y = y, x
        self.size[x] += self.size[y]
        self.nodes[y] = x

    def same(self, x, y):
        return self.root(x) == self.root(y)

N,K,L = map(int,input().split())

uf1 = Unionfind(N)
uf2 = Unionfind(N)

for _ in range(K):
    p,q = map(int,input().split())
    p -= 1; q -= 1
    uf1.unite(p,q)

for _ in range(L):
    r,s = map(int,input().split())
    r -= 1; s -= 1
    uf2.unite(r,s)

keys = []
dic = {}

for node in range(N):
    key = (uf1.root(node),uf2.root(node))
    keys.append(key)
    if key in dic:
        dic[key] += 1
    else:
        dic[key] = 1

ans = [str(dic[key]) for key in keys]
print(" ".join(ans))

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

class Unionfind:

    __slots__ = ['nodes','size']

    def __init__(self, n):
        self.nodes = list(range(n))
        self.size = [1]*n

    def root(self, x):
        if self.nodes[x] == x:
            return x
        else:
            root_x = self.root(self.nodes[x])
            self.nodes[x] = root_x
            return root_x

    def unite(self, x, y):
        x = self.root(x); y = self.root(y)
        if x == y:
            return
        if self.size[x] < self.size[y]:
            x, y = y, x
        self.size[x] += self.size[y]
        self.nodes[y] = x

    def same(self, x, y):
        return self.root(x) == self.root(y)

N,K,L = map(int,input().split())
road = [[int(e)-1 for e in input().split()] for _ in range(K)]
rail = [[int(e)-1 for e in input().split()] for _ in range(L)]

uf1 = Unionfind(N)
uf2 = Unionfind(N)

for p,q in road:
    uf1.unite(p,q)

for r,s in rail:
    uf2.unite(r,s)

set1 = [0]*N
set2 = [0]*N

for node in range(N):
    if node == uf1.root(node):
        set1[node] = set()
    set1[node] = set1[uf1.root(node)]
    set1[node].add(node)
    if node == uf2.root(node):
        set2[node] = set()
    set2[node] = set2[uf2.root(node)]
    set2[node].add(node)

ans = []

for node in range(N):
    ans.append(str(len(set1[node] & set2[node])))

print(" ".join(ans))
Problem p03856 (python)

Fixed submission:
S = input()
S = S.replace("eraser","@").replace("erase","@").replace("dreamer","@").replace("dream","@")
if set(S) == set("@"):
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
def main():

    import sys
    input = sys.stdin.readline
    from collections import defaultdict

    class Unionfind:

        __slots__ = ['parents','sizes']

        def __init__(self, n):
            self.parents = list(range(n))
            self.sizes = [1]*n

        def root(self, x):
            if self.parents[x] == x:
                return x
            else:
                root_x = self.root(self.parents[x])
                self.parents[x] = root_x
                return root_x

        def unite(self, x, y):
            x = self.root(x); y = self.root(y)
            if x == y:
                return
            if self.sizes[x] < self.sizes[y]:
                x, y = y, x
            self.sizes[x] += self.sizes[y]
            self.parents[y] = x

        def same(self, x, y):
            return self.root(x) == self.root(y)

        # 集合自体の数 ({1,2}, {3}, {4} : kind -> 3)
        def kind(self):
            for v in range(N):
                self.root(v)
            return len(list(set(self.parents)))

        # xが属する集合の要素の数　({1,2,3} : size(2) -> 3)
        def size(self, x):
            self.sizes[x] = self.sizes[self.root(x)]
            return self.sizes[x]

    N, K, L = map(int,input().split())
    road = Unionfind(N)
    train = Unionfind(N)

    for _ in range(K):
        p, q = map(int,input().split())
        p -= 1; q -= 1
        road.unite(p, q)

    for _ in range(L):
        r, s = map(int,input().split())
        r -= 1; s -= 1
        train.unite(r, s)

    ans_list = []

    r = defaultdict(set)
    t = defaultdict(set)
    for i in range(N):
        r[road.root(i)].add(i)
        t[train.root(i)].add(i)

    ans_list = []

    for i in range(N):
        ans = len(r[road.root(i)] & t[train.root(i)])
        ans_list.append(ans)

    print(*ans_list)

if __name__ == "__main__":
    main()
Problem p03999 (python)

Fixed submission:
s = input()
l = [s[0]]
d = len(s) - 1
if d == 0:
  print(s)
  exit()
def operate_1(string):
  return string
def operate_2(string):
  string += "+"
  return string
# l,d は未定義注意
def bfs(list_hoge = l,depth = 0,deepest = d):
    queue = []
    for e in list_hoge:
        for b in [0,1]:
            if b == 0:
                operated = operate_1(e)
                operated += s[depth + 1]
                queue.append(operated)
            elif b == 1:
                operated = operate_2(e)
                operated += s[depth + 1]
                queue.append(operated)
    list_hoge = queue[:]
    depth += 1
    if depth == deepest:
        return list_hoge
    else:
        return bfs(list_hoge,depth)
ans = 0
for e in bfs():
  ans += eval(e)
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
l = [s[0]]
d = len(s) - 1
def operate_1(string):
  return string
def operate_2(string):
  string += "+"
  return string
# l,d は未定義注意
def bfs(list_hoge = l,depth = 0,deepest = d):
    queue = []
    for e in list_hoge:
        for b in [0,1]:
            if b == 0:
                operated = operate_1(e)
                operated += s[depth + 1]
                queue.append(operated)
            elif b == 1:
                operated = operate_2(e)
                operated += s[depth + 1]
                queue.append(operated)
    list_hoge = queue[:]
    depth += 1
    if depth == deepest:
        return list_hoge
    else:
        return bfs(list_hoge,depth)
ans = 0
for e in bfs():
  ans += eval(e)
print(ans)
Problem p04030 (python)

Fixed submission:
s = input()
editor = [""]
for e in s:
    if e == "0":
        editor.append("0")
    elif e == "1":
        editor.append("1")
    elif e == "B" and editor != []:
        del editor[-1]
print("".join(editor))

Buggy submission (verdict: Runtime Error):
s = input()
editor = [""]
for e in s:
    if e == "0":
        editor.append("0")
    elif e == "1":
        editor.append("1")
    elif e == "B" and editor != "":
        del editor[-1]
print("".join(editor))
Problem p02817 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,k = input().strip().split()
a,b,k = [int(a), int(b), int(k)]

if k < a:
	a = a-k
elif k >= a+b:
	a = 0
	b = 0
elif a+b > k > a:
	b = b-(k-a)
	a = 0

print('{} {}'.format(a,b))

Buggy submission (verdict: Runtime Error):
a,b,k = input().strip().split
a,b,k = [int(a), int(b), int(k)]

if k < a:
	a = a-k
elif k >= a+b:
	a = 0
	b = 0
elif a+b > k > a:
	b = b-(k-a)
	a = 0

print('{} {}'.format(a,b))

Buggy submission (verdict: Runtime Error):
a,b,k = input().strip().split
a,b,k = [int(a), int(b), int(k)]

if k < a:
	a = a-k
elif k >= a+b:
	a = 0
	b = 0
elif a+b > k > a:
	b = b-(k-a)
    a = 0

Buggy submission (verdict: Runtime Error):
a,b,k = input().strip().split
a,b,k = [int(a), int(b), int(k)]

if k < a:
	a = a-k
elif k >= a+b:
    a = 0
    b = 0
elif a+b > k > a:
    b = b-(k-a)
	a = 0

Buggy submission (verdict: Runtime Error):
a,b,k = input().strip().split
a,b,k = [int(a), int(b), int(k)]

for i in range(c):
  if k < a:
    a = a-k
  elif k >= a+b:
    a = 0
    b = 0
  elif a+b > k > a:
    b = b-(k-a)
	a = 0
Problem p02818 (python)

Fixed submission:
a,b,k = input().strip().split()
a,b,k = [int(a), int(b), int(k)]

if k <= a:
	a = a-k
elif k >= a+b:
	a = 0
	b = 0
elif a+b > k > a:
	b = b-(k-a)
	a = 0

print('{} {}'.format(a,b))

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

for i in range(c):
  if a > 0:
    a -= 1
  elif b > 0:
    b -= 1

print('{} {}'.format(a, b))
Problem p03029 (python)

Fixed submission:
a, p = map(int, input().split())
total = 3 * a + p
print(total//2)

Buggy submission (verdict: Runtime Error):
a, p = map(int, input().split())
print(sum(3 * a + p)//2)
Problem p02817 (python)

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

print(b+a)

Buggy submission (verdict: Runtime Error):
dfsfd

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

if a <= k:
  k -= a
  a = 0
else:
  a -= k
  k = 0

b = max(0, b - k)

print(a, b)

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
num = min(a,k)
a -= num
k -= num
print(a,max(b-k,0))

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
num = min(a,k)
a -= num
k -= num
print(a,max(b-k,0))

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

if A == 0:
  print(0, max(0, B - K))
elif B == 0:
  print(max(0, A - K), 0)
elif K == 0:
  print(A, B)

A_from_0 = A
B_from_0 = B

if (A_from_0 - K) >= 0:
  A -= K
  K = 0
else:
  A = 0
  K -= A_from_0
  
if (B_from_0 - K) > 0:
  B -= K
  K = 0
else:
  B = 0
  K -= B_from_0

if K == 0:
  print(A, B)
if K == 1:
  print(0, 1)
elif K > 1:
  print(0, 0)

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

if A == 0:
  print(0, max(0, B - K))
elif B == 0:
  print(max(0, A - K), 0)
elif K == 0:
  print(A, B)

A_from_1 = A - 1
B_from_1 = B - 1

if (A_from_1 - K) >= 0:
  A -= K
  K = 0
else:
  A = 1
  K -= A_from_1
  
if (B_from_1 - K) > 0:
  B -= K
  K = 0
else:
  B = 1
  K -= B_from_1

if K == 0:
  print(A, B)
if K == 1:
  print(0, 1)
elif K > 1:
  print(0, 0)

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

diff = abs(A - B)
a_is_higher = A > B

if K <= diff:
  if a_is_higher:
  	print(A-K, B)
  else:
    print(A, B-K)
else:
  if a_is_higher:
  	A -= diff
  else:
    B -= diff
  K -= diff
  div, mod = divmod(K, 2)
  
  nA = A - div
  nB = B - div
  
  if mod:
    nA -= 1
  
  nA = max(0, nA)
  nB = max(0, nB)
  
  print(nA, nB)

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

diff = abs(A - B)
a_is_higher = A > B

if K <= diff:
  if a_is_higher:
  	print(A-K, B)
  else:
    print(A, B-K)
else:
  if a_is_higher:
  	A -= diff
  else:
    B -= diff
  K -= diff
  div, mod = divmod(K, 2)
  
  nA = Math.max(0, A // 2)
  nB = Math.max(0, B // 2)
  
  if mod:
    print(nA, nB + 1)
  else:
    print(nA, nB)

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

if a[0] < b[0]:
  print(a+b)
else:
  print(b+a)
Problem p02830 (python)

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

result = ''
for idx in range(n):
  result += s[idx] + t[idx]

print(result)

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

result = ''
for idx in range(n):
  result += s[idx] + t[idx]

  print(result)
Problem p02885 (python)

Fixed submission:

a, b = map(int, input().split(' '))
ans = a - 2 * b
if ans < 0:
	ans = 0
print(ans)

Buggy submission (verdict: Runtime Error):

a, b = map(int, input.split(''))
ans = a - 2 * b
if ans < 0:
	ans = 0
print(ans)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input.split(''))
ans = a - 2 * b
if ans < 0:
  ans = 0
 print(ans)
Problem p02946 (python)

Fixed submission:
K, X = list(map(int, input().split()))
minimum = max(-1000000, X - (K - 1))
maximum = min(X + (K - 1), 1000000)
print(' '.join(map(str, range(minimum, maximum + 1))))

Buggy submission (verdict: Runtime Error):
    K, X = list(map(int, input().split()))
    minimum = max(-1000000, X - (K - 1))
    maximum = min(X + (K - 1), 1000000)
    print(' '.join(map(str, range(minimum, maximum + 1))))
Problem p02957 (python)

Fixed submission:
import sys
input = sys.stdin.readline

A, B = map(int, input().split())
if (A + B) % 2 == 0:
    print( (A + B) // 2)
else:
    print('IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
s = input()
s = s[::-1]
mod = 10 ** 9 + 7
table = [[0] * 13 for _ in range(len(s) + 2)]
table[0][0] = 1
dd = 1
for c in range(len(s)):
    if s[c] == "?":
        for n in range(10):
            for i in range(13):
                table[c + 1][(i + n * dd) % 13] += table[c][i]
                table[c + 1][(i + n * dd) % 13] %= mod
    else:
        num = int(s[c])
        for i in range(13):
            table[c + 1][(i + num * dd) % 13] += table[c][i]
            table[c + 1][(i + num * dd) % 13] %= mod
    dd = (dd * 10) % 13
print(table[c + 1][5])
Problem p02972 (python)

Fixed submission:
import sys
input = sys.stdin.readline

N = int(input())
A = [0] + list(map(int, input().split()))
B = [0] * (N+1)

ans = []
for i in range(N, 0, -1):
    sum = 0
    for j in range(2 * i, N+1, i):
        sum ^= B[j]
    B[i] = sum ^ A[i]
    if B[i]:
        ans.append(str(i))

print(len(ans))
if ans:
    print(' '.join(ans))

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

N = int(input())
A = [0] + list(map(int, input().split()))
B = [0] * (N+1)aimport sys
input = sys.stdin.readline

N = int(input())
A = [0] + list(map(int, input().split()))
B = [0] * (N+1)

ans = []
for i in list(range(N, 0, -1)):
    sum = 0
    for j in list(range(2 * i, N, i)):
        sum ^= B[j]
    B[i] = sum ^ A[i]
    if B[i]:
        ans.append(str(i))

print(len(ans))
if ans:
    print(' '.join(ans))


ans = []
for i in range(N, 0, -1):
    sum = 0
    for j in range(2 * i, N, i):
        sum ^= B[j]
    B[i] = sum ^ A[i]
    if B[i]:
        ans.append(str(i))
        
print(len(ans))
if ans:
    print(' '.join(ans))

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

N = int(input())
A = [0] + list(map(int, input().split()))
B = [0 for _ in range(N+1)]

for i in range(N, 0, -1):aimport sys
input = sys.stdin.readline

N = int(input())
A = [0] + list(map(int, input().split()))
B = [0] * (N+1)

for i in range(N, 0, -1):
    sum = 0
    for j in range(2 * i, N, i):
        sum ^= B[j]
    B[i] = sum ^ A[i]
ans = []
for i in range(1, N+1):
    if B[i]:
        ans.append(str(i))
print(len(ans))
if ans:
    print(' '.join(ans))

    sum = 0
    for j in range(2 * i, N, i):
        sum ^= B[j]
    B[i] = sum ^ A[i]
ans = []
for i in range(1, N+1):
    if B[i]:
        ans.append(str(i))
print(len(ans))
if ans:
    print(' '.join(ans))
Problem p03455 (python)

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

if(a * b)%2 == 0:
  print("Even")
  
else:
  print("Odd")

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

if(a * b) % 2 == 0:
  print("Even")
  
  else:
    print("Odd")
Problem p03478 (python)

Fixed submission:
n, a, b = map(int, input().split())
ans = 0
for i in range(n+1):
  if a <= sum(list(map(int, list(str(i))))) <= b:
    ans += i
print(ans)

Buggy submission (verdict: Runtime Error):
a, a, b = map(int, input().split())
ans = 0
for i in range(n+1):
  if a <= sum(list(map(int, list(str(i))))) <= b:
    ans += i
print(ans)
Problem p03493 (python)

Fixed submission:
s = input()

cnt = 0

for c in s:
  if c == "1":
    cnt += 1

print(cnt)

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

step = 0
while True:
  flag = False
  for i range(N):
    if A[i] % 2 ==0:
      A[i] = A[i] / 2
      else:
        flag =True
        break
        
        if flag:
          break
          step +=1
          
print(step)

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

step = 0
while True:
  flag = False
  for i in range(N):
    if A[i] %2 == 0:
      A[i] = A[i]/2
      else:
        flag = True
        break
        
        if flag:
          break
          step +=1

print(step)
Problem p03494 (python)

Fixed submission:
import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))

Buggy submission (verdict: Runtime Error):
import math
a = input()
n = list(map(int, input().split()))
ans = float("inf")
for i in a:
  ans = min(ans, len(bin(i)) - bin(i).rfind("1")-1)
print(round(ans))

Buggy submission (verdict: Runtime Error):
import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i a:
  ans = min(ans, len(bin(i)) - bin(i).rfind("1")-1)
  print(round(ans))

Buggy submission (verdict: Runtime Error):
import math

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

ans = float("inf")

for i a:
  ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
  
  print(round(ans))

Buggy submission (verdict: Runtime Error):
def hmtd(n):
  ans = 0
  while n % 2 == 0:
    n /= 2
    and += 1
  return ans

n = int(input())
a = map(int, input().split())
ans = min(map(hmtd, a))

print(ans)
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 p02818 (python)

Fixed submission:
a, b, k = map(int, input().split())
if a + b >= k:
    if a > k:
        print(a-k,b)
    elif k >= a and a+b >= k:
        print(0,a + b -k)
else:
    print(0,0)

Buggy submission (verdict: Runtime Error):
 a, b, k = map(int, input().split())
for x in range(k):
    if a >= 1:
         a -= 1
    elif a == 0 and b >=1:
        b = b - 1
    elif a == 0 and b==0:
        pass
print(a, b)
Problem p02995 (python)

Fixed submission:
import fractions as fr
a,b,c,d = input().split()
a = int(a)
b= int(b)
c = int(c)
d = int(d)
s = b-a+1

cd = c*d // fr.gcd(c,d)
a_ = ((a-1)//c + (a-1)//d) - ((a-1)//cd)
b_ = (b//c + b//d) - (b//cd)
s_ = b_- a_
print(s-s_)

Buggy submission (verdict: Runtime Error):
import math
a,b,c,d = input().split()
a = int(a)
b= int(b)
c = int(c)
d = int(d)
s = b-a+1

cd = c*d // math.gcd(c,d)
a_ = ((a-1)//c + (a-1)//d) - ((a-1)//cd)
b_ = (b//c + b//d) - (b//cd)
s_ = b_- a_
print(s-s_)

Buggy submission (verdict: Runtime Error):
import math
a,b,c,d = input().split()
a = int(a)
b= int(b)
c = int(c)
d = int(d)
s = b-a+1

cd = c*d // math.gcd(c,d)
a_ = ((a-1)//c + (a-1)//d) - ((a-1)//cd)
b_ = (b//c + b//d) - (b//cd)
s_ = b_- a_
print(s-s_)
Problem p03029 (python)

Fixed submission:
a,p = map(int,input().split())
print((3*a+p)//2)

Buggy submission (verdict: Runtime Error):
n = int(input())
dic = {}
for x in range(n):
  dic[x+1] = input().split()
ls = sorted(dic.items(), key=lambda x:x[1][0])

for y in range(1,n-1):
  
  if ls[y][1][0] == ls[y+1][1][0]:
    
    if ls[y][1][1] < ls[y+1][1][1]:
      
      ls[y+1],ls[y] = ls[y],ls[y+1]
    
    
for b in range(len(ls)):
  print(ls[b][0])
Problem p03035 (python)

Fixed submission:
a,b = map(int,input().split())
if a <= 5:
    print(0)
elif 6 <= a <= 12:
    print(int(b*0.5))
else:
    print(b)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
lm = list(map(int,input().split()))
ln = []
for _ in range(m):
    ln.append(list(map(int,input().split())))
for a in range(m):
    for b in range(ln[a][0]):
        if  ln[a][1] > min(lm) :
            c = min(lm)
            lm[lm.index(c)] =  ln[a][1] 
    print('aa')
print(sum(lm))

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
lm = list(map(int,input().split()))
ln = []
for _ in range(m):
    ln.append(list(map(int,input().split())))
Problem p02817 (python)

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

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