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

Fixed submission:
if __name__ == '__main__':
    # AB = [int(i) for i in input().split()]
    S = str(input())
    K = int(input())
    for n, i in enumerate(S):
        if n+1 == K:
            print(i)
            break
        if i != '1':
            print(i)
            break

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':
    # AB = [int(i) for i in input().split()]
    S = str(input())
    K = int(input())
    for i, n in enumerate(S):
        if n+1 == K:
            print(i)
            break
        if i != '1':
            print(i)
            break

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':
    #AB = [int(i) for i in input().split()]
    S = input()
    K = int(input())
    for i in S:
        if i == K:
            print(n)
            break
        if i != '1':
	    print(n)
	    break
Problem p03076 (python)

Fixed submission:
from math import ceil
minutes = [int(input()) for _ in range(5)]

arr = [(x, x%10) for x in minutes if x%10 != 0]
if arr:
    x = min(arr, key=lambda x: x[1])
    minutes.remove(x[0])
    print(sum([ceil(x/10)*10 for x in minutes])+x[0])
else:
    print(sum(minutes))

Buggy submission (verdict: Runtime Error):
from math import ceil
minutes = [int(input()) for _ in range(5)]

x = min([(x, x%10) for x in minutes if x%10 != 0], key=lambda x: x[1])

minutes.remove(x[0])
print(sum([ceil(x/10)*10 for x in minutes])+x[0])
Problem p03087 (python)

Fixed submission:
n, q = [int(x) for x in input().split(' ')]
s = input()
lr = [[int(x) for x in input().split(' ')] for _ in range(q)]


indexes = [0] * n

for i in range(1, len(s)):
    if s[i-1] == 'A' and s[i] == 'C':
        indexes[i] = indexes[i-1]+1
    else:
        indexes[i] = indexes[i-1]

for l, r in lr:
    print(indexes[r-1]-indexes[l-1])

Buggy submission (verdict: Runtime Error):
n, q = [int(x) for x in input().split(' ')]
s = input()
lr = [[int(x) for x in input().split(' ')] for _ in range(q)]

indexes = []
for i in range(1, len(s)):
    if s[i-1] == 'A' and s[i] == 'C':
        indexes.append([i-1, i])

print('\n'.join([len([x for x in indexes if l-1 <= x[0] and x[1] <= r-1]) for l, r in lr]))
Problem p03503 (python)

Fixed submission:
n = int(input())
f = [input().split(' ') for _ in range(n)]
p = [input().split(' ') for _ in range(n)]
res = -10 ** 7 * n
for num in range(1, 1024):
  tmp = 0
  for index in range(0, n):
    tmp += int(p[index][len([True for x in range(0, 10) if f[index][x]=='{:010b}'.format(num)[x]=='1'])])
  res = max(tmp, res)
print(res)

Buggy submission (verdict: Runtime Error):
n = int(input())
f = [input().split(' ') for _ in range(n)]
p = [input().split(' ') for _ in range(n)]
res = -10**8
for num in range(1, 1024):
  tmp = 0
  for index in range(0, n):
    tmp += int(p[index][len([True for x in range(0, 10) if f[index][x]==f'{num:010b}'[x]=='1'])])
  res = max(tmp, res)

print(res)
Problem p03636 (python)

Fixed submission:
s = input()
print(s[0]+str(len(s[1:-1]))+s[-1])

Buggy submission (verdict: Runtime Error):
 s = input()
 print(s[0]+str(len(s[1:-1]))+s[-1])
Problem p03721 (python)

Fixed submission:
n, k = [int(x) for x in input().split(' ')]
ab = sorted([[int(x) for x in input().split(' ')]  for _ in range(n)])
index = 0

for a in ab:
    index += int(a[1])
    if index >= k:
        print(a[0])
        break

Buggy submission (verdict: Runtime Error):
n, k = [int(x) for x in input().split(' ')]
ab = [(input().split(' ')) for _ in range(n)]
index = 0

for a, b  in ab:
    index += int(b)
    if index >= k:
        print(a)
        breaka
Problem p03061 (python)

Fixed submission:
import math
N = int(input())
A = sorted(list(map(int, input().split())))
if N == 2:
    print(max(A))
    exit()
result = []
num = 0
for a in A[1:]:
    if a % A[0] != 0:
        num += 1
        if num == 2:
            break
else:
    result.append(A[0])
for n in range(2, int(math.sqrt(A[0])) + 1):
    if A[0] % n != 0:
        continue
    num = 0
    x = A[0] // n
    for a in A[1:]:
        if a % x != 0:
            num += 1
            if num == 2:
                break
    else:
        result.append(x)
    num = 0
    for a in A[1:]:
        if a % n != 0:
            num += 1
            if num == 2:
                break
    else:
        result.append(n)
num = 0
B = A[0:1] + A[2:]
for a in B:
    if a % A[1] != 0:
        num += 1
        if num == 2:
            break
else:
    result.append(A[1])
for n in range(2, int(math.sqrt(A[1])) + 1):
    if A[1] % n != 0:
        continue
    num = 0
    x = A[1] // n
    for a in B:
        if a % x != 0:
            num += 1
            if num == 2:
                break
    else:
        result.append(x)
    num = 0
    for a in B:
        if a % n != 0:
            num += 1
            if num == 2:
                break
    else:
        result.append(n)
if len(result) != 0:
    print(max(result))
else:
    print(1)

Buggy submission (verdict: Runtime Error):
import math
N = int(input())
A = sorted(list(map(int, input().split())))
if N == 2:
    print(max(A))
    exit()
result = []
num = 0
for a in A[1:]:
    if a % A[0] != 0:
        num += 1
        if num == 2:
            break
else:
    result.append(A[0])
for n in range(2, int(math.sqrt(A[0])) + 1):
    if A[0] % n != 0:
        continue
    num = 0
    for a in A[1:]:
        if a % n != 0:
            num += 1
            if num == 2:
                break
    else:
        result.append(n)
    num = 0
    x = A[0] // n
    for a in A[1:]:
        if a % x != 0:
            num += 1
            if num == 2:
                break
    else:
        result.append(x)
num = 0
for a in A[0:1] + A[2:]:
    if a % A[1] != 0:
        num += 1
        if num == 2:
            break
else:
    result.append(A[1])
for n in range(2, int(math.sqrt(A[1])) + 1):
    if A[1] % n != 0:
        continue
    num = 0
    for a in A[0:1] + A[2:]:
        if a % n != 0:
            num += 1
            if num == 2:
                break
    else:
        result.append(n)
    num = 0
    x = A[1] // n
    for a in A[0:1] + A[2:]:
        if a % x != 0:
            num += 1
            if num == 2:
                break
    else:
        result.append(x)
print(max(result))
Problem p03074 (python)

Fixed submission:
N, K = map(int, input().split())
S = input()
if S == "0":
    print(1)
    exit()
if S.count("0") == N:
    print(N)
    exit()
L = [0]
prev = S[0]
num = 1
for s in S[1:]:
    if s == prev:
        num += 1
    else:
        L.append(num)
        num = 1
        prev = s
L.append(num)
# print(L)
for i in range(1, len(L)):
    L[i] += L[i - 1]
# print(L)
left = 0
if S[0] == "1":
    right = min(2 * K + 1, len(L) - 1)
else:
    right = min(2 * K, len(L) - 1)
num = 0
while right < len(L):
    # print("L[" + str(right) + "] - L[" + str(left) + "] = " + str(L[right] - L[left]))
    num = max(num, L[right] - L[left])
    if left == 0 and S[0] == "0":
        left += 1
    else:
        left += 2
    right += 2
if S[-1] == "0":
    right -= 1
    # print("L[" + str(right) + "] - L[" + str(left) + "] = " + str(L[right] - L[left]))
    num = max(num, L[right] - L[left])
print(num)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
S = input()
L = [0]
prev = S[0]
num = 1
for s in S[1:]:
    if s == prev:
        num += 1
    else:
        L.append(num)
        num = 1
        prev = s
L.append(num)
# print(L)
for i in range(1, len(L)):
    L[i] += L[i - 1]
# print(L)
left = 0
if S[0] == "1":
    right = min(2 * K + 1, len(L) - 1)
else:
    right = min(2 * K, len(L) - 1)
num = 0
while right < len(L):
    # print("L[" + str(right) + "] - L[" + str(left) + "] = " + str(L[right] - L[left]))
    num = max(num, L[right] - L[left])
    if left == 0 and S[0] == "0":
        left += 1
    else:
        left += 2
    right += 2
if S[-1] == "0" and len(S) > 1:
    right -= 1
    # print("L[" + str(right) + "] - L[" + str(left) + "] = " + str(L[right] - L[left]))
    num = max(num, L[right] - L[left])
print(num)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
S = input()
L = [0]
prev = S[0]
num = 1
for s in S[1:]:
    if s == prev:
        num += 1
    else:
        L.append(num)
        num = 1
        prev = s
L.append(num)
# print(L)
for i in range(1, len(L)):
    L[i] += L[i - 1]
# print(L)
left = 0
if S[0] == "1":
    right = min(2 * K + 1, len(L) - 1)
else:
    right = min(2 * K, len(L) - 1)
num = 0
while right < len(L):
    # print("L[" + str(right) + "] - L[" + str(left) + "] = " + str(L[right] - L[left]))
    num = max(num, L[right] - L[left])
    if left == 0 and S[0] == "0":
        left += 1
    else:
        left += 2
    right += 2
if S[-1] == "0":
    right -= 1
    # print("L[" + str(right) + "] - L[" + str(left) + "] = " + str(L[right] - L[left]))
    num = max(num, L[right] - L[left])
print(num)
Problem p03644 (python)

Fixed submission:
N = int(input())
if N == 1:
    print(1)
    exit()
X = [2, 4, 8, 16, 32, 64, 128]
for i, x in enumerate(X):
    if N < x:
        print(X[i - 1])
        exit()

Buggy submission (verdict: Runtime Error):
N = int(intput())
if N == 1:
  print(1)
  exit()
X = [2, 4, 8, 16, 32, 64, 128]
for i, x in enumerate(X):
  if N < x:
    print(X[i - 1])
Problem p02922 (python)

Fixed submission:
a, b = list(map(int, input().split()))
ans, outlet = 0, 1
while outlet < b:
  outlet -= 1
  outlet += a
  ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
import math
a,b = list(map(int, input().split())
if a > b:
	print(1)
else:
	print(math.ceil(b/a))
Problem p02922 (python)

Fixed submission:
m, n = input().split()
m, n = int(m), int(n)
 
tot = 0
a = 1
while a<n:
  a-=1
  a+=m
  tot+=1
 
print(tot)

Buggy submission (verdict: Runtime Error):
m, n = input().split()
m, n = int(m), int(n)
 
tot = 0
a = 1
while a<n:
  a-=1
  a+=m
  tot+=1
 
print(c)
Problem p04043 (python)

Fixed submission:
a = map(int,input().split())
if sorted(a) == [5,5,7]:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
N, L= map(int,input().split())
alldata = sorted([input() for i in range(N)])
print("".join(data))
Problem p04044 (python)

Fixed submission:
N, L= map(int,input().split())
data = sorted([input() for i in range(N)])
print("".join(data))

Buggy submission (verdict: Runtime Error):
N, L= map(int,input().split())
alldata = sorted([input() for i in range(N)])
print("".join(data))
Problem p02922 (python)

Fixed submission:
import sys
def input():
    return sys.stdin.readline()[:-1]

# 整数複数個
A, B = map(int, input().split())

C = -((-B+1) // (A-1))
print(C)

Buggy submission (verdict: Runtime Error):
A = int(input()) #ここで標準入力
B = int(input()) #ここで標準入力

C = A/B + 1

print(C)
Problem p02922 (python)

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

ans = (a + b - 3) // (a - 1)
print(ans)

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

if ((min_ans - mod_ans) > 0) :
  print(min_ans)
else : 
  print(mins_ans + 1)

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

if(b % a == 0) :
  print(ans)
else :
  print(ans + 1)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
strip = b // a
emp = b % a
ans = strip + (strip // emp)
print(ans)
Problem p02945 (python)

Fixed submission:
a,b=map(int, input().split())
print(max(a+b,a-b,a*b))

Buggy submission (verdict: Runtime Error):
a,b=map(int, input().split())
print(max(a+b,a-b,a*b)

Buggy submission (verdict: Runtime Error):
if A+B > A-B and A*B:
  print(A+B)
elif A-B > A+B and A*B :
  print(A-B)
else A*B > A+B and A-B :
  print(A*B)
Problem p03288 (python)

Fixed submission:
R = int(input())
if R < 1200:
    print("ABC")
elif 1200 <= R < 2800:
    print("ARC")
else :
    print("AGC")

Buggy submission (verdict: Runtime Error):
R = int(input())
if R < 1200:
    print("ABC")
elif 1200 <= R < 2800:
    print("ARC")
else print("AGC")

Buggy submission (verdict: Runtime Error):
R = input()
if R < 1200:
    print("ABC")
elif 1200 <= R < 2800:
    print("ARC")
else print("AGC")
Problem p03292 (python)

Fixed submission:
A = list(map(int, input().split()))
print(max(A)-min(A))

Buggy submission (verdict: Runtime Error):
A = list(map(int(), input().split()))
print(max(A)-min(A))
Problem p03471 (python)

Fixed submission:
N,Y = map(int,input().split())
A = list(range(0,N+1))
a=-1
b=-1
c=-1
for i in A:
    for j in list(range(0,N-i+1)):
        if 10000*i+5000*j+1000*(N-i-j) == Y:
            a=i
            b=j
            c=N-i-j
            break
print(a,b,c)

Buggy submission (verdict: Runtime Error):
N,Y = map(int,input().split())
A = list(range(0,N+1))
B = list(range(0,N-A+1))
a=-1
b=-1
c=-1
for i in A:
    for j in B:
        if 10000*i+5000*j+1000*(N-i-j) == Y:
            a=i
            b=j
            c=N-i-j
            break
print(a,b,c)

Buggy submission (verdict: Runtime Error):
N,Y = map(int,input().split())
A = list(range(0,N+1))
B = list(range(0,N-A+1))
a=-1
b=-1
c=-1
for i in A:
    for j in B:
        if 10000*i+5000*j+1000*(N-i-j) == Y:
            a=i
            b=j
            c=N-i-j
            break
a=str(a)
b=str(b)
c=str(c)
print(a+" "+b+" "+c)

Buggy submission (verdict: Runtime Error):
N,Y = map(int,input().split())
A = list(range(0,N+1))
B = list(range(0,N-A+1))
a=-1
b=-1
c=-1
for i in A:
    for j in B:
        if 10000*i+5000*j+1000*(N-i-j) == Y:
            a=i
            b=j
            c=N-i-j
            break
print([a,b,c])
Problem p03502 (python)

Fixed submission:
x = int(input())
def f(x):
    return sum(map(int, list(str(x))))
if x % f(x) == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
x = input()
def f(x):
    return sum(map(int, list(str(x))))
if x % f(x) == 0:
    print("Yes")
else:
    print("No")
Problem p02923 (python)

Fixed submission:
N = int(input())
H = list(map(int, input().split()))
l=0
t_l = 0
for i in range(N-1):
  if H[i] >= H[i+1]:
    t_l = t_l + 1
    if l < t_l:
      l = t_l
  else:
    t_l=0
print(l)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = input().split()
l=0
for i in range(N):
  if H[i] >= H[i+1]:
      t_l = t_l + 1
  else:
    if l < t_l:
      l = t_l
    t_l=0
print(l)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = input().split()
l=0
for i in range(N):
  t_l=0
  for j in range(i, N-1):
    if H[j] >= H[j+1]:
      t_l = t_l + 1
    else:
      break
  if l < t_l:
    l = t_l
  i=j+1
print(l)
Problem p03485 (python)

Fixed submission:
import math

a, b = map(int, input().split(" "))
ans = math.ceil((a + b)/2)
print(ans)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split(" "))
ans = upper((a + b)/2)
print(ans)
Problem p04044 (python)

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

words = []
for i in range(N):
  word = input()
  words.append(word)

words.sort()
print("".join(words))

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

words = []
for i in range(L):
  word = input()
  words.append(word)

words.sort()
print("".join(words))
Problem p03087 (python)

Fixed submission:
n, q = map(int, input().split())
s = input()
t = [[int(x) for x in input().split()] for _ in range(q)]
add_list = [0]
for i in range(len(s)-1):
    if s[i:i+2] == "AC":
        add_list.append(add_list[i]+1)
    else:
        add_list.append(add_list[i])
for i in t:
    ans = add_list[i[1]-1] - add_list[i[0]-1]
    print(ans)

Buggy submission (verdict: Runtime Error):
b = "ACACTACG"
n, q = map(int, input().split())
b = input()
a = [[int(x) for x in input().split()] for _ in range(q)]
for j in range(len(b)-1):
        if b[j] == "A" and b[j+1] == "C":
            ans.append(1)
        else:
            ans.append(0)
for i in a:
    print(sum(ans[i[0]:i[1]]))
Problem p03136 (python)

Fixed submission:
n = int(input())
nums = list(map(int, input().split()))
nums.sort()
if nums[n-1] < sum(nums[:n-1]):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
nums = list(map(int, input().split()))
nums.sort()
if nums[n] < sum(nums[:n]):
    print("Yes")
else:
    print("No")
Problem p03292 (python)

Fixed submission:
li = list(map(int,input().split()))
li.sort()
#li
print(li[2]-li[1]+li[1]-li[0])

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
ans=0
for i in range(0,len(s)):
    a=s[i:]
    b=s[:i]
    ss=a+b
    print(ss)
    if ss == t:
        ans = 1
if ans == 1:
    print("Yes")
else:
    print("No")
Problem p03702 (python)

Fixed submission:
a,b,c = map(int, input().split())
l = [int(input()) for _ in range(a)]
flag = True
l = sorted(l)
max_T = 10**18
def ok(k):
    s = k
    for i in l:
        hp = i - c * k
        if hp > 0:
            s -= -(-hp // (b - c))
        if s < 0:
            return False
    return True
def binary_search(l,r):
    mid = (l + r) // 2
    if l == r:
        return l
    elif ok(mid):
        return binary_search(l,mid)
    else:
        if mid == l:
            mid += 1
            
        return binary_search(mid,r)
ans = binary_search(0,max_T)
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c = map(int, input().split())
l = [int(input()) for _ in range(a)]
flag = True
l = sorted(l)
max_T = 10**18
def ok(k):
    s = k
    for i in l:
        hp = i - c * k
        if hp > 0:
            s -= -(-hp // (b - c))
        if s < 0:
            return False
    return True
def binary_search(l,r):
    mid = (l + r) // 2
    if l == r:
        return l
    elif ok(mid):
        return bbb(l,mid)
    else:
        if mid == l:
            mid += 1
            
        return bbb(mid,r)
ans =binary_search(0,max_T)
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c = map(int, input().split())
l = [int(input()) for _ in range(a)]
flag = True
l = sorted(l)
max_T = 10**18
def ok(k):
    s = k
    for i in l:
        hp = i - c * k
        if hp > 0:
            s -= -(-hp // (b - c))
        if s < 0:
            return False
    return True
def binary_search(l,r):
    mid = (l + r) // 2
    if l == r:
        return l
    elif ok(mid):
        return bbb(l,mid)
    else:
        if mid == l:
            mid += 1
            
        return bbb(mid,r)
binary_search(0,max_T)
Problem p03006 (python)

Fixed submission:
from collections import Counter


def main():
    N = int(input())
    points = []
    for _ in range(N):
        x, y = [int(i) for i in input().split()]
        points.append([x, y])

    diffs = []
    if N == 1:
        print(1)
        return

    for i in range(N):
        for j in range(N):
            if i == j:
                pass
            else:
                x = points[i][0] - points[j][0]
                y = points[i][1] - points[j][1]
                diffs.append("{}_{}".format(x, y))

    c = Counter(diffs).most_common(1)[0][1]
    print(N-c)


main()

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

N = int(input())
points = []
for _ in range(N):
    x, y = [int(i) for i in input().split()]
    points.append([x, y])

diffs = []
for i in range(N):
    for j in range(N):
        if i == j:
            pass
        else:
            x = points[i][0] - points[j][0]
            y = points[i][1] - points[j][1]
            diffs.append("{}_{}".format(x, y))

c = Counter(diffs).most_common(1)[0][1]
print(N-c)
Problem p03044 (python)

Fixed submission:
from queue import Queue

N = int(input())

BLACK = -1
GRAY = 0
WHITE = 1
nodes = [GRAY] * N
nodes[0] = BLACK
neighbors = [[] for _ in range(N)]

for n in range(N-1):
    u, v, w = [int(i) for i in input().split()]
    neighbors[u-1].append((v-1, w))
    neighbors[v-1].append((u-1, w))


def bfs():
    q = Queue()
    q.put(0)
    while not q.empty():
        u = q.get()

        neiss = neighbors[u]
        for neis in neiss:
            v, w = neis
            if nodes[v] == GRAY:
                if w % 2 == 0:
                    nodes[v] = nodes[u]
                else:
                    nodes[v] = -nodes[u]
                q.put(v)


bfs()

for n in nodes:
    if n == BLACK:
        print(0)
    else:
        print(1)

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

BLACK = -1
GRAY = 0
WHITE = 1
nodes = [GRAY] * N
nodes[0] = BLACK
neighbors = [[] for _ in range(N)]

for n in range(N-1):
    u, v, w = [int(i) for i in input().split()]
    neighbors[u-1].append((v-1, w))
    neighbors[v-1].append((u-1, w))


def dfs(u):
    neiss = neighbors[u]
    for neis in neiss:
        v, w = neis
        if nodes[v] == GRAY:
            if w % 2 == 0:
                nodes[v] = nodes[u]
            else:
                nodes[v] = -nodes[u]
            dfs(v)


dfs(0)

for n in nodes:
    if n == BLACK:
        print(0)
    else:
        print(1)

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

BLACK = -1
GRAY = 0
WHITE = 1
nodes = [GRAY] * N
nodes[0] = BLACK
neighbors = [[] for _ in range(N)]

for n in range(N-1):
    u, v, w = [int(i) for i in input().split()]
    neighbors[u-1].append((v-1, w))
    neighbors[v-1].append((u-1, w))


def dfs(u):
    neiss = neighbors[u]
    for neis in neiss:
        v, w = neis
        if nodes[v] == GRAY:
            if w % 2 == 0:
                nodes[v] = nodes[u]
            else:
                nodes[v] = -nodes[u]
            dfs(v)


dfs(0)

for n in nodes:
    if n == BLACK:
        print(0)
    else:
        print(1)
Problem p03076 (python)

Fixed submission:
A = []
for _ in range(5):
    A.append(int(input()))
ans = sum([-10 * (-i//10) for i in A])
ans -= max([(10 - (i % 10)) % 10 for i in A])
print(ans)

Buggy submission (verdict: Runtime Error):
A = []
for _ in range(5):
    A.append(int(input())
ans = sum(A)
mod = [i % 10 for i in A]
ans = ans - 10 + min(mod)
print(ans)
Problem p03284 (python)

Fixed submission:
N, K = [int(i) for i in input().split()]
print(0) if N % K == 0 else print(1)

Buggy submission (verdict: Runtime Error):
N, K = [int(i) for i in input()]
print(0) if N % K == 0 else print(1)
Problem p03311 (python)

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]
for i in range(N):
    A[i] = A[i] - (i+1)
A.sort()
b = A[N//2]
ans = 0
for a in A:
    ans += abs(a - b)
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split()]
diff = [0] * N
for i in range(N):
    diff[i] = A[i] - (i+1)
diff.sort

b1 = diff[len(diff) - 1 // 2]
b2 = diff[(len(diff)) // 2]

ans1 = 0
for i, a in enumerate(A):
    ans1 += abs(a - (i+1+b1))
ans2 = 0
for i, a in enumerate(A):
    ans2 += abs(a - (i+1+b2))
print(min(ans1, ans2))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split()]
diff = [0] * N
for i in range(N):
    diff[i] = A[i] - (i+1)
diff.sort

b1 = diff[len(diff) // 2]
b2 = diff[(len(diff) + 1) // 2]

ans1 = 0
for i, a in enumerate(A):
    ans1 += abs(a - (i+1+b1))
ans2 = 0
for i, a in enumerate(A):
    ans2 += abs(a - (i+1+b2))
print(min(ans1, ans2))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split()]
diff = [0] * N
for i in range(N):
    diff[i] = A[i] - (i+1)
diff.sort

b1 = diff[len(diff) // 2]
b2 = diff[len(diff) // 2 + 1]

ans1 = 0
for i, a in enumerate(A):
    ans1 += abs(a - (i+1+b1))
ans2 = 0
for i, a in enumerate(A):
    ans2 += abs(a - (i+1+b2))
print(min(ans1, ans2))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split()]
diff = [0] * N
for i in range(N):
    diff[i] = A[i] - (i+1)
diff.sort

b1 = diff[len(diff) // 2]
b2 = diff[len(diff) // 2 + 1]

ans1 = 0
for i, a in enumerate(A):
    ans1 += abs(a - (i+1+b1))
ans2 = 0
for i, a in enumerate(A):
    ans2 += abs(a - (i+1+b2))
print(min(ans1, ans2))
Problem p03351 (python)

Fixed submission:
a, b, c, d = [int(i) for i in input().split()]
if abs(a-c) <= d:
    print("Yes")
elif abs(a-b) <= d and abs(b-c) <= d:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a, b, c, d = [int(i) for i in input().split()]
if abs(a-c) <= d:
    print("Yes")
elif abc(a-b) <= d and abc(b-c) <= d:
    print("Yes")
else:
    print("No")
Problem p03469 (python)

Fixed submission:
a = input()
b = a[0:3] + '8' + a[4:]
print(b)

Buggy submission (verdict: Runtime Error):
s = input()
s[3] = '7'
print(s)