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

Fixed submission:
a = input()
b = input()
if(a == b[::-1] and b == a[::-1]):
    print('YES')
else:
    print('NO')

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

if(a == b[::-1] and b == a[::-1]):
    print('YES')
else:
    print('NO')
Problem p03565 (python)

Fixed submission:
#!/usr/bin/env python3



# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    # Failed to predict input format
    S = input().replace('?', '.')
    T = input()

    import re
    import sys

    for i in range(len(S)-len(T),-1,-1):
        if(re.match(S[i:i+len(T)],T)):
            S = S.replace('.', 'a')
            print(S[:i]+T+S[i+len(T):])
            exit()
    else:
        print("UNRESTORABLE")
    
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3



# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    # Failed to predict input format
    St = list(input())
    T = input()

    # print(len(T))
    f = False
    for i in range(len(St)):
        if(St[i] == T[0]):
            cnt = 0
            for j in range(len(T)):
                if(T[j] == St[i+j] or St[i+j] == '?'):
                    # if(cnt == len(T)-1):
                    #     St[i:i+j] = T[j]
                    cnt += 1
                else:
                    break
            if(cnt == len(T)):
                for j in range(len(T)):
                    St[i+j] = T[j]
                f = True
    # print(St)
    if(f):
        print(''.join(St).replace('?', 'a'))
    else:
        print('UNRESTORABLE')
    
    
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3



# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    # Failed to predict input format
    St = list(input())
    T = input()

    # print(len(T))
    f = False
    for i in range(len(St)):
        if(St[i] == T[0]):
            cnt = 0
            for j in range(len(T)):
                if(T[j] == St[i+j] or St[i+j] == '?'):
                    # if(cnt == len(T)-1):
                    #     St[i:i+j] = T[j]
                    continue
                else:
                    break
            if(cnt == len(T[j])-1):
                for j in range(len(T)):
                    St[i+j] = T[j]
                f = True
    # print(St)
    if(f):
        print(''.join(St).replace('?', 'a'))
    else:
        print('UNRESTORABLE')
    
    
if __name__ == '__main__':
    main()
Problem p03599 (python)

Fixed submission:
#!/usr/bin/env python3
import sys
from math import ceil, floor

def solve(A: int, B: int, C: int, D: int, E: int, F: int):
    
    x = []
    y = []  

    for i in range(ceil(F/(100*A))+1):
        for j in range(ceil(F/(100*B))+1):
            dx = 100*A*i+100*B*j
            if(min(100*A,100*B) <= dx <= F):
                x.append(dx)

    for i in range(ceil(F/C)+1):
        for j in range(ceil(F/C)+1):
            dy = C*i+D*j
            if(0 <= dy <= F):
                y.append(dy)

    x = sorted(list(set(x)))
    y = sorted(list(set(y)))
    
    w = x[0]
    s = y[0]

    for i in x:
        for j in y:
            de = 100*s/(w+s)
            ne = 100*j/(i+j)
            if(i+j <= F and de < ne <= 100*E/(100+E)):
                # print(i, j, ne)
                w = i
                s = j

    print(w+s, s)

    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    D = int(next(tokens))  # type: int
    E = int(next(tokens))  # type: int
    F = int(next(tokens))  # type: int
    solve(A, B, C, D, E, F)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
from math import ceil, floor

def solve(A: int, B: int, C: int, D: int, E: int, F: int):
    
    x = []
    y = []  

    for i in range(ceil(F/(100*A))+1):
        for j in range(ceil(F/(100*B))+1):
            dx = 100*A*i+100*B*j
            if(100*min(A,B) <= dx <= F):
                x.append(dx)

    for i in range(ceil(F/C)+1):
        for j in range(ceil(F/C)+1):
            dy = C*i+D*j
            if(0 <= dy <= F):
                y.append(dy)

    x = sorted(list(set(x)))
    y = sorted(list(set(y)))
    
    w = x[1]
    s = y[1]

    for i in x:
        for j in y:
            de = 100*s/(w+s)
            ne = 100*j/(i+j)
            if(i+j <= F and de < ne <= 100*E/(100+E)):
                # print(i, j, ne)
                w = i
                s = j

    print(w+s, s)

    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    D = int(next(tokens))  # type: int
    E = int(next(tokens))  # type: int
    F = int(next(tokens))  # type: int
    solve(A, B, C, D, E, F)

if __name__ == '__main__':
    main()
Problem p03605 (python)

Fixed submission:
n = input()
if(n[0] == '9' or n[1] == '9'):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys


def solve(N: int, M: int, R: int, r: "List[int]", A: "List[int]", B: "List[int]", C: "List[int]"):

    '''
    Warshall-Floyd
    input:  c[|V|][|V|]
            input example to from cost
            (c[i][i] == 0)
    Output: Minimun cost of all paths in the inputed graph 
    '''
    V = N
    INF = 1<<32
    d = [[INF] * (N+1) for i in range(N+1)]
 
    for i in range(M):
        d[A[i]][B[i]] = C[i]
        d[B[i]][A[i]] = C[i]

    for k in range(N+1):
        for i in range(N+1):
            if d[i][k] == INF : continue
            for j in range(N+1):
                if d[k][j] == INF: continue
                d[i][j] = min(d[i][j], d[i][k]+d[k][j])


    ans = INF

    from itertools import product
    for i in product(r,repeat=len(r)):
        # print(i)
        if(len(i) != len(set(i))): continue
        ta = 0
        for j in range(1,len(i)):
            ta += d[i[j-1]][i[j]]
        
        ans = min(ans, ta)
    
    print(ans)

    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    R = int(next(tokens))  # type: int
    r = [int(next(tokens)) for _ in range(R)]  # type: "List[int]"
    A = [int()] * (M)  # type: "List[int]"
    B = [int()] * (M)  # type: "List[int]"
    C = [int()] * (M)  # type: "List[int]"
    for i in range(M):
        A[i] = int(next(tokens))
        B[i] = int(next(tokens))
        C[i] = int(next(tokens))
    solve(N, M, R, r, A, B, C)

if __name__ == '__main__':
    main()
Problem p03633 (python)

Fixed submission:
#!/usr/bin/env python3
import sys
from fractions import gcd
# from math import gcd
from functools import reduce

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


def solve(N: int, T: "List[int]"):
    print(reduce(lcm, T))
    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    T = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, T)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
# from fractions import gcd
from math import gcd
from functools import reduce

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


def solve(N: int, T: "List[int]"):
    print(reduce(lcm, T))
    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    T = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, T)

if __name__ == '__main__':
    main()
Problem p03993 (python)

Fixed submission:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10000000)
INF = 1<<32
from bisect import bisect_left, bisect_right

def solve(N: int, a: "List[int]"):
    # x = [[i+1, a[i]] for i in range(N)]

    # x = sorted(x, key=lambda x:x[1])
    # x1 = [i for i,j in x]
    # x2 = [j for i,j in x]

    # ans = 0
    # for i in range(N):
    #     p = bisect_left(x2, x1[i])
    #     if not (0 <= p < N):
    #         continue
    #     if x1[i] == x2[p] and x2[i] == x1[p]:
    #         ans += 1

    # print(ans//2)

    ans = 0
    for i in range(N):
        if a[a[i]-1] == i+1:
            ans += 1

    print(ans//2)


    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, a)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10000000)
INF = 1<<32
from bisect import bisect_left, bisect_right

def solve(N: int, a: "List[int]"):
    x = [[i+1, a[i]] for i in range(N)]

    x = sorted(x, key=lambda x:x[1])
    x1 = [i for i,j in x]
    x2 = [j for i,j in x]

    ans = 0
    for i in range(N):
        p = bisect_left(x2, x1[i])
        if x1[i] == x2[p]:
            if x2[i] == x1[p]:
                ans += 1

    print(ans//2)

    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, a)

if __name__ == '__main__':
    main()
Problem p02606 (python)

Fixed submission:
l,r,d = map(int,input().split())
print(r//d - (l-1)//d)

Buggy submission (verdict: Runtime Error):
l,r,d = map(int,input.split())
print((l-r+1) // d)

Buggy submission (verdict: Runtime Error):
l,r,d=map(int,input.split())
print((l-r+1)//d)

Buggy submission (verdict: Runtime Error):
l,r,d = map(int,input().split())
print((r//d - l//d)

Buggy submission (verdict: Runtime Error):
l,r,d = map(str,input.split())
l = int(l)
r = int(r)
d = int(d)
print((r-l+1)//d)

Buggy submission (verdict: Runtime Error):
l,r,d = map(int,input.split())
print((r-l+1)//d)

Buggy submission (verdict: Runtime Error):
l,r,d = map(int,input.split())
print((l-r+1)//d)
Problem p02621 (python)

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

Buggy submission (verdict: Runtime Error):
a = int(input())
print(a(1+a+a*a))
Problem p02641 (python)

Fixed submission:
x,n = map(int,input().split())
if n == 0:
  print(x)
  exit()
if n != 0:
  p = sorted(map(int,input().split()))
aa = []
for i in range(1,101):
  if not i in p:
    aa.append(i)
bb = []
if len(aa) == 0:
  if abs(x-(0)) <= abs(x-101):
    print(0)
    exit()
  else:
    print(101)
    exit()
else:
  for A in aa:
    eee = abs(x-A)
    bb.append(eee)

ans = bb.index(min(bb))
if abs(x-(0)) <= min(bb):
  print(0)
  exit()
elif abs(x-101) < min(bb):
  print(101)
  exit()
else:
  print(aa[ans])
  exit()

Buggy submission (verdict: Runtime Error):
x,n = map(int,input().split())
if n == 0:
  print(x)
  exit()
if n != 0:
  p = sorted(map(int,input().split()))
aa = []
for i in range(1,101):
  if not i in p:
    aa.append(i)
bb = []
if len(aa) != 0:
  for A in aa:
    eee = abs(x-A)
    bb.append(eee)

ans = bb.index(min(bb))
if abs(x-(-1)) <= min(bb):
  print(-1)
elif abs(x-101) <= min(bb):
  print(101)
else:
  print(aa[ans])

Buggy submission (verdict: Runtime Error):
x,n = map(int,input().split())
if n == 0:
  print(x)
  exit()
if n != 0:
  p = sorted(map(int,input().split()))
aa = []
for i in range(1,101):
  if not i in p:
    aa.append(i)
bb = []
for A in aa:
  eee = abs(x-A)
  bb.append(eee)

ans = bb.index(min(bb))
print(aa[ans])
Problem p02660 (python)

Fixed submission:
import collections
import math

n = int(input())
B = [1,3,6,10,15,21,28,36,45,55,66,78,91,105]
ans = 0

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True
if is_prime(n) == True:
  print(1)
  exit()

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

c = collections.Counter(prime_factorize(n))  
for v in c.values():
  for j in range(len(B)):
    if v < B[j]:
      ans += j
      break
      
print(ans)

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

n = int(input())
B = [1,2,6,10,15,21,28,36,45,55]
ans = 0

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True
if is_prime(n) == True:
  print(1)
  exit()

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
c = collections.Counter(prime_factorize(840))  
C = c.values()
for i in range(len(C)):
  for j in range(len(B)):
    if C[i] < B[j]:
      ans += j+1
      break

print(ans)

Buggy submission (verdict: Runtime Error):
import sympy
n = int(input())
B = [1,2,6,10,15,21,28,36,45,55]
ans = 0
import math
def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

if is_prime(n) == True:
  print(ans)
  exit()


A = sympy.factorint(n)
for v in A.values():
  for i in range(len(B)):
    if v <= B[i]:
      cnt = 1
    else:
      cnt = 0
    if cnt == 0:
      ans += i+1
print(ans)
Problem p02678 (python)

Fixed submission:
from collections import deque

N, M = map(int, input().split())
G = [[] for _ in range(N)]

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

q = deque([0])
dist = [-1]*N
dist[0] = 0

while q:
  v = q.popleft()
  for nv in G[v]:
    if dist[nv] == -1:
      dist[nv] = v+1
      q.append(nv)

print("Yes")
print(*dist[1:], sep="\n")

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

dist = [-1] * (n + 1)
roots = [[] for i in range(n + 1)]

for i in range(m):
    a, b = map(int, input().split())
    roots[a].append(b)
    roots[b].append(a)

ans = [-1] * (n + 1)
ans[1] = 0
dist[1] = 0
q = deque()
q.append(1)

while q:
    now = q.popleft()

    for next_v in roots[now]:
        if not dist[next_v] == -1:
            continue
        dist[next_v] = dist[now] + 
        ans[next_v] = now
        q.append(next_v)
if -1 in ans[1:]:
    print('No')
else:
    print('Yes')
    for i in range(2, len(ans)):
        print(ans[i])

Buggy submission (verdict: Runtime Error):
inf = 10**5+1
n,m = map(int,input().split())
p = [inf]*n
for _ in range(n):
  a,b = map(int,input().split())
  A = max(a,b)
  B = min(a,b)
  if p[A-1] > B:
    p[A-1] = B
  if p[B-1] > A:
    p[B-1] = A
p[0] = 'Yes'
if max(p[1:]) == 10**5+1:
  print('No')
else:
  for i in range(len(p)):
    print(p[i])
Problem p02683 (python)

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

A = [[] for _ in range(n)]
c = [0] * n

for i in range(n):
    c_as = list(map(int, input().split()))
    c[i], A[i] = c_as[0], c_as[1:]

INF = 10**9
ans = INF
    
for s in range(0, 1 << n):
    smart = [0] * m
    cost_sum = 0
    for i in range(n):
        if (s >> i) % 2 == 0:continue
        cost_sum += c[i]
        for j in range(m):
            smart[j] += A[i][j]
    ok = True
    for j in range(m):
        if smart[j] < X:
            ok = False
    if ok:
        ans = min(ans, cost_sum)

if ans == INF:
    ans = -1

print(ans)

Buggy submission (verdict: Runtime Error):
n,m,x = map(int,input().split())
A = list(map(int,input().split()))
A.sort(key=lambda x: x[0])
money = 0
ans = 0
for i in range(n):  
  c = A[i][0]
  a = A[i][1:]
  aa = min(a)
  money += c
  ans += aa
  if ans >= x:
    print(money())
    exit()
print(-1)
Problem p02690 (python)

Fixed submission:
X = int(input())

AA = 0
BB = 0

for A in range(-121,121):
    for B in range(-121,121):
        if X == (A ** 5) - (B ** 5):
            AA = A
            BB = B

print(AA,BB)

Buggy submission (verdict: Runtime Error):
x = int(input())
A = [i**5 for _ in range(1500)]
for i in range(1500):
  for j in range(1500):
    if A[i]  == x + A[j]:
      print(A[i],A[j])
      break
Problem p02694 (python)

Fixed submission:
X = int(input())
y = 100
ans = 0
while True:
  ans += 1
  y += y//100
  if X <= y:
    break
print(ans)

Buggy submission (verdict: Runtime Error):
x = int(input())
ans = 0
a = 100
While a < x:
  a = a**1.01
  ans += 1  
print(ans)

Buggy submission (verdict: Runtime Error):
x = int(input())
ans = 0
for _ in range():
  a = 100**1.01
  ans += 1
  if a >= x:
    exit()
print(ans)
Problem p02702 (python)

Fixed submission:
s,l = (input(),2019)
m,a,r = ([1]+[0]*l,0,0)
for i,e in enumerate(s[::-1]):
    a += int(e)*pow(10,i,l)
    r += m[a%l]
    m[a%l] += 1
print(r)

Buggy submission (verdict: Runtime Error):
s = input()
ans = 0
sss = []
for i in range(len(s)):
  for j in range(len(s)):
    a = s[i:i+j+2]
    sss.append(a)
    
sssss = set(sss)
for i in sssss:
  if int(sssss[i]) % 2019 == 0:
    ans += 1
      
      
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
ans = 0
S =[]
for i in range(len(s)):
  for j in range(len(s)):
    a = s[i:i+j+2]
    S.append(a)
sa = set(S)
for i in range(len(se)):
  if int(sa[i]) % 2019 == 0:
    ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
ans = 0
af = 0
for i in range(len(s)):
  for j in range(len(s)):
    a = s[i:i+j+3]
    if len(a) <= 200000:
      af = 0
    else int(a) % 2019 == 0:
      ans += 1

print(ans)

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

for i in range(len(s)):
  for j in range(len(s)):
    a = s[i:i+j]
    if int(a) % 2019 == 0:
      ans += 1

print(ans)

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

for i in range(len(s)):
  for j in range(len(s)):
    a = s[i:i+j]
    if int(a) % 2019 == 0:
      ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
ans = 0
for i in range(len(s)):
  for j in range(len(s)):
  a = s[i:i+j]
  if int(a) % 2019 == 0:
    ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
ans = 0
if int(s) < 2019 :
  print(0)
else:
  for i in range(len(s)-3):
    for j in range(4,len(s)):
      a =s[i:j+1]
      if int(a) % 2019 == 0:
        ans += 1
        
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
L = [s[i] for i in range(len(s))]
ans = 0

for j in range(0,len(L)-3):
  for k in range(3,len(L)):
    a = int(L[j:k+1])
    if a % 2019 == 0:
      ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
ans = 0
for i in range(0,len(s)-3):
  for j in range(3,len(s)):
    a = int(s[i:j+1])
    if a % 2019 == 0:
      ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
ans = 0
for i in range(0,len(s)-2):
  for j in range(3,len(s)+1):
    a = s[i:j+1]
    if a%2019 == 0:
      ans += 1
print(ans)
Problem p02705 (python)

Fixed submission:
import math
n = int(input())
print(2*n*math.pi)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
ptint(2*n*math.pi)
Problem p02708 (python)

Fixed submission:
N,K = map(int, input().split())
min_num = 0
max_num = 0
for i in range(K):
    min_num += i
    max_num += N - i
ans = max_num - min_num + 1
for i in range(K, N+1):
    min_num += i
    max_num += N - i
    ans += max_num - min_num + 1
print(ans%(10**9 + 7))

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

ans=[0]*n

for i in l:
    ans[i-1]+=1

for j in ans:
    print(j)
Problem p02717 (python)

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

print(c,a,b)

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

print("c"),
print("a"),
print("b"),

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

print('b,a,c')
Problem p02719 (python)

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

print(min(N%K,abs(N%K-K)))

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
if n > 0:
  n = n-k
elif n <= 0:
  break
m = abs(n)
l = abs(m-k)
print(min(m,l))

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
if n > 0:
  n = n-k
elif n == 0:
  n = 0
else:
  break
m = abs(n-k)
print(min(n,m))

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
if n > 0:
  n = n-k
elif n == 0:
  n = 0
else:
  m = abs(n-k)
print(min(n,m))

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
if n > 0:
  n = n-k
elif n == 0:
  n = 0
else:
  m = abs(n-k)
print(min(n,abs(n-k))
Problem p02741 (python)

Fixed submission:
N =[1,1,1,2,1,2,1,5,2,2,1,5,1,2,1,14,1,5,1,5,2,2,1,15,2,2,5,4,1,4,1,51]
K =int(input())
print(N[K-1])

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

Buggy submission (verdict: Runtime Error):
N =[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K =int(input())
print(N[K+1])
Problem p02742 (python)

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

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
if h==1 or w==1:
  print(1)
elif h*w // 2 = 0:
  print(h*w//2)
else:
  print(h*w//2+1)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if a == 1 and b == 1:
  print(1)
else:
  print(a*b // 2+1)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if a == 1 and b == 1:
  print(0)
elif a*b % 2 == 0:
  print(a*b // 2)
else:
  print(a*b // 2 + 1)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if a*b % 2 == 1:
  print(a*b // 2+1)
else:
  print(a*b // 2)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if a*b % 2 = 1:
  print(a*b // 2+1)
else:
  print(a*b // 2)

Buggy submission (verdict: Runtime Error):
a,b = int(input().split())
if a*b % 2 = 0:
  print(a*b//2)
else:
  print(a*b//2+1)