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

Fixed submission:
s = input()
 
s = s[::-1]
 
dp = [[0 for _ in range(13)] for __ in range(len(s)+1)]
 
l = len(s)
 
 
if s[0] == '?':
    for j in range(10):
        dp[0][j] = 1
else:
    dp[0][int(s[0])] = 1
 
m = 1
MOD = 10**9 +7
 
for i in range(1,len(s)):
    m = m*10 % 13
 
    if s[i] == '?':
        for k in range(13):
            for j in range(10):
                dp[i][(j*m+k)%13] += dp[i-1][k]
                dp[i][k] %= MOD
    else:
        for k in range(13):
            dp[i][(int(s[i])*m + k) %13] += dp[i-1][k]
            dp[i][k] %= MOD
 
print(dp[len(s)-1][5] % MOD )

Buggy submission (verdict: Runtime Error):
s = input()
 
s = s[::-1]
 
dp = [0 for _ in range(13)]
 
if s[0] == '?':
    for j in range(10):
        dp[j] = 1
else:
    dp[int(s[0])] = 1

m = 1
MOD = 10**9 +7
 
s = s[1:]

for w in s:
    m = m*10 % 13
    ans = [0 for _ in range(13)]
 
    if w == '?':
        for k in range(13):
            for j in range(10):
                ans[(j*m+k)%13] += dp[k]
                ans[k] % MOD
    else:
        for k in range(13):
            ans[(int(w)*m + k) %13] += dp[k]
            ans[k] % MOD
    for k in range(13):
        dp[k] = ans[k]
        ans[k] = ans[k] % MOD
 
print(ans[5] % MOD )

Buggy submission (verdict: Runtime Error):
s = input()
 
s = s[::-1]
 
dp = [0 for _ in range(13)]
 
if s[0] == '?':
    for j in range(10):
        dp[j] = 1
else:
    dp[int(s[0])] = 1
m = 1
MOD = 10**9 +7
 
for i in range(1,len(s)):
    m = m*10 % 13
    ans = [0 for _ in range(13)]
 
    if s[i] == '?':
        for k in range(13):
            for j in range(10):
                ans[(j*m+k)%13] += dp[k]
                ans[k] % MOD
    else:
        for k in range(13):
            ans[(int(s[i])*m + k) %13] += dp[k]
            ans[k] % MOD
    for k in range(13):
        dp[k] = ans[k]
        ans[k] = ans[k] % MOD

print(ans[5] % MOD )
Problem p02994 (python)

Fixed submission:
def solve():
    n,l = map(int,input().split())
    if l > 0:
        print(int(n*(l-1)+n*(n+1)/2-l))
    elif l <= 0 and l +n-1 >=0:
        print(int(n*(l-1)+n*(n+1)/2))
    else:
        print(int(n*(l-1)+n*(n+1)/2-l-n+1))
    return 0

solve()

Buggy submission (verdict: Runtime Error):
    n,l = map(int,input().split())
    if l > 0:
        print(int(n*(l-1)+n*(n+1)/2-l))
    elif l <= 0 and l +n-1 >=0:
        print(int(n*(l-1)+n*(n+1)/2))
    else:
        print(int(n*(l-1)+n*(n+1)/2-l-n+1))
Problem p03093 (python)

Fixed submission:
n, m = map(int, input().split())
a = sorted([int(x) for x in input().split()])


def chk(x):
    for i in range(2*x, 2*n):
        if i != 2*n - 1 - (i - 2*x) and a[i] + a[2*n-1-(i-2*x)] < m:
            return False
    return True


bottom = -1
top = n

while top - bottom > 1:
    mid = (top + bottom)//2
    if chk(mid):
        top = mid
    else:
        bottom = mid

ans = -1

for i in range(2*top, 2*n):
    ans = max(ans, (a[i]+a[2*n-1-(i-2*top)]) % m)
for i in range(2*top):
    ans = max(ans, (a[i] + a[2*top-1-i]) % m)

print(ans)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = sorted([int(x) for x in input().split()])

if n == 1:
    print(sum(a) % m)
    exit()


def chk(x):
    for i in range(2*x, 2*n):
        if i != 2*n - 1 - (i - 2*x) and a[i] + a[2*n-1-(i-2*x)] < m:
            return False
    for i in range(2*x):
        if i != 2*x-1-i and a[i] + a[2*x-1-i] >= m:
            return False
    return True


bottom = -1
top = n+1

while top - bottom > 1:
    mid = (top + bottom)//2
    if chk(mid):
        top = mid
    else:
        bottom = mid
    if top == 0:
        break

ans = -1

for i in range(2*top, 2*n):
    ans = max(ans, (a[i]+a[2*n-1-(i-2*top)]) % m)
for i in range(2*top):
    ans = max(ans, (a[i] + a[2*top-1-i]) % m)

print(ans)
Problem p03152 (python)

Fixed submission:
mod = 10**9+7
n, m = map(int, input().split())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]

aa = [0 for _ in range(n*m)]
bb = [0 for _ in range(n*m)]

for i in range(n):
    if aa[n*m-a[i]] == 0:
        aa[n*m-a[i]] = 1
    else:
        print(0)
        exit()

for j in range(m):
    if bb[n*m-b[j]] == 0:
        bb[n*m-b[j]] = 1
    else:
        print(0)
        exit()

for i in range(n*m):
    if i == 0:
        continue
    aa[i] += aa[i-1]
    bb[i] += bb[i-1]

aa = aa[::-1]
bb = bb[::-1]

seta = set(a)
setb = set(b)

ans = 1

for x in range(1, n*m+1)[::-1]:
    if x in seta and x in setb:
        continue
    elif x in seta and x not in setb:
        ans *= bb[x-1]
        ans %= mod
    elif x not in seta and x in setb:
        ans *= aa[x-1]
        ans %= mod
    elif aa[x-1]*bb[x-1] - (n*m-x) > 0:
        ans *= aa[x-1]*bb[x-1] - (n*m-x)
        ans %= mod
    else:
        print(0)
        exit()

print(ans)

Buggy submission (verdict: Runtime Error):
mod = 10**9+7
n, m = map(int, input().split())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]

a = sorted(a, reverse=True)
b = sorted(b, reverse=True)

c = [0 for _ in range(n*m)]
for i in range(n):
    c[a[i]-1] += 1
    if c[a[i]-1] == 2:
        print(0)
        exit()

c = [0 for _ in range(n*m)]
for i in range(m):
    c[b[i]-1] += 1
    if c[b[i]-1] == 2:
        print(0)
        exit()

ans = 1

i = 0
j = 0

while i < n and j < m:
    if n*m > max(a[i], b[j]) + i*j:
        print(0)
        exit()
    if a[i] == b[i]:
        i += 1
        j += 1
    elif a[i] > b[j]:
        ans *= j
        ans %= mod
        i += 1
    else:
        ans *= i
        ans %= mod
        j += 1

res = n*m - min(n, m)

for i in range(1, res+1):
    ans *= i
    ans %= mod

print(ans)

Buggy submission (verdict: Runtime Error):
mod = 10**9+7
n, m = map(int, input().split())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]

a = sorted(a, reverse=True)
b = sorted(b, reverse=True)

c = [0 for _ in range(n*m)]
for i in range(n):
    c[a[i]-1] += 1
    if c[a[i]-1] == 2:
        print(0)
        exit()

c = [0 for _ in range(n*m)]
for i in range(m):
    c[b[i]-1] += 1
    if c[b[i]-1] == 2:
        print(0)
        exit()

ans = 1

i = 0
j = 0

while i < n and j < m:
    if n*m > max(a[i], b[j]) + i*j:
        print(0)
        exit()
    if a[i] == b[i]:
        i += 1
        j += 1
    elif a[i] > b[j]:
        ans *= i
        ans %= mod
        i += 1
    else:
        ans *= j
        ans %= mod
        j += 1

res = n*m - min(n, m)

for i in range(1, res+1):
    ans *= i
    ans %= mod

print(ans)
Problem p03164 (python)

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

dp = [[float('inf') for _ in range(10**5+1)] for i in range(n)]

for i in range(n):
    wi, vi = map(int, input().split())
    if i == 0:
        dp[i][0] = 0
        dp[i][vi] = wi
    else:
        for k in range(10**5+1):
            if k < vi:
                dp[i][k] = dp[i-1][k]
            else:
                dp[i][k] = min(dp[i-1][k], dp[i-1][k-vi]+wi)

for i in range(10**5+1)[::-1]:
    if dp[n-1][i] <= w:
        print(i)
        exit()

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

dp = [[float('inf') for _ in range(10**5+1)] for i in range(n)]

v_sum = 0

for i in range(n):
    wi, vi = map(int, input().split())
    v_sum += vi
    if i == 0:
        dp[i][0] = 0
        dp[i][vi] = wi
    else:
        for k in range(v_sum+1):
            if k < vi:
                dp[i][k] = dp[i-1][k]
            else:
                dp[i][k] = min(dp[i-1][k], dp[i-1][k-vi]+wi)

for i in range(v_sum+1,-1,-1):
    if dp[n-1][i] <= w:
        print(i)
        exit()
Problem p03175 (python)

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

mod = 10**9+7
n = int(input())
g = [[] for _ in range(n)]

for _ in range(n-1):
    x, y = map(int, input().split())
    g[x-1].append(y-1)
    g[y-1].append(x-1)

white = [0 for _ in range(n)]
black = [0 for _ in range(n)]


def dfs(v):
    tmp_w = 1
    tmp_b = 1
    if len(g[v]) == 0:
        white[v] = 1
        black[v] = 1
        return None
    for w in g[v]:
        g[w].remove(v)
        dfs(w)
        tmp_w *= white[w]+black[w]
        tmp_b *= white[w]
        tmp_w %= mod
        tmp_b %= mod
    white[v] = tmp_w
    black[v] = tmp_b
    return None


dfs(0)

print((white[0]+black[0]) % mod)

Buggy submission (verdict: Runtime Error):
mod = 10**9+7
n = int(input())
g = [[] for _ in range(n)]

for _ in range(n-1):
    x, y = map(int, input().split())
    g[x-1].append(y-1)
    g[y-1].append(x-1)

white = [0 for _ in range(n)]
black = [0 for _ in range(n)]


def dfs(v):
    tmp_w = 1
    tmp_b = 1
    if len(g[v]) == 0:
        white[v] = 1
        black[v] = 1
        return None
    for w in g[v]:
        g[w].remove(v)
        dfs(w)
        tmp_w *= white[w]+black[w]
        tmp_b *= white[w]
        tmp_w %= mod
        tmp_b %= mod
    white[v] += tmp_w
    black[v] += tmp_b
    return None


dfs(0)

print((white[0]+black[0]) % mod)

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

g = [[] for _ in range(n)]

for _ in range(n-1):
    x, y = map(int, input().split())
    g[x-1].append(y-1)
    g[y-1].append(x-1)

white = [0 for _ in range(n)]
black = [0 for _ in range(n)]


def dfs(v):
    tmp_w = 1
    tmp_b = 1
    if len(g[v]) == 0:
        white[v] = 1
        black[v] = 1
        return None
    for w in g[v]:
        g[w].remove(v)
        dfs(w)
        tmp_w *= white[w]+black[w]
        tmp_b *= white[w]
    white[v] += tmp_w
    black[v] += tmp_b
    return None


dfs(0)

print(white[0]+black[0])
Problem p03262 (python)

Fixed submission:
import fractions

n,x = map(int,input().split())

def dist(n):
    return abs(int(n)-x)

a = list(map(dist,input().split()))

ans = a[n-1]

for i in range(n):
    ans = fractions.gcd(ans,a[i])

print(ans)

Buggy submission (verdict: Runtime Error):
import math

n,x = map(int,input().split())

def dist(n):
    return abs(int(n)-x)

a = list(map(dist,input().split()))

ans = a[n-1]

for i in range(n):
    ans = math.gcd(ans,a[i])

print(ans)

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

n,x = map(int,input().split())

def dist(n):
    return abs(int(n)-x)

a = list(map(dist,input().split()))

def gcds(*s):
    return reduce(math.gcd, s)

print(gcds(*a))

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

n,x = map(int,input().split())

def dist(n):
    return abs(int(n)-x)

a = list(map(dist,input().split()))

def gcds(*s):
    return reduce(math.gcd, s)

print(gcds(*a))

Buggy submission (verdict: Runtime Error):
import math

n,x = map(int,input().split())

ans = abs(int(input())-x)

if n > 1:
	for _ in range(n-1):
  		ans = math.gcd(ans, abs(int(input())-x) )

print(ans)
Problem p03282 (python)

Fixed submission:
s = list(map(int,list(input())))
k = int(input())

a = 0
i = 0

while a < k:
  a += min(s[i]**70, k)
  i +=1

print(s[i-1])

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())

i = 0

while s[i] == '1' and i < k:
  i += 1

print(int(s[i]))

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())

i = 0

while s[i] == '1' and i < k:
  i += 1

print(s[i])

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())

a = 0
for i in range(k+1):
  if s[i] != '1':
    a = 1
    print(int(s[i]))
    break
if a = 0:
  print(1)

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())

if s[:k] == '1'*k:
  print(1)
else:
  print(int(s.translate(str.maketrans('','','1'))[0]))

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())

if k <= len(s):
  print(s[k-1])
elif s[:k] == '1'*k:
  print(1)
else:
  print(s.translate(str.maketrans('','','1'))[0])

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())

if s[:k] == '1'*k:
  print(1)
else:
  print(s.translate(str.maketrans('','','1'))[0])

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())

i = 0
while s[i] == '1' or i+1 < k:
	i += 1  
print(int(s[i]))

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())

if k == 1:
  print(int(s[0]))
else:
  i = 0
  while s[i] == '1':
    i += 1
  print(int(s[i]))

Buggy submission (verdict: Runtime Error):
s = list(map(int,list(input())))
k = int(input())

for j in range(1,5*(10**15)):
  a = ''
  for i in range(len(s)):
    a += str(s[i])*s[i]**j
  if len(a) >= k:
    print(a[k-1])
    break
Problem p03328 (python)

Fixed submission:
a,b = map(int, input().split())
print((b-a)*(b-a-1)//2 - a)

Buggy submission (verdict: Runtime Error):
a,b = int(input().split())
print((b-a)*(b-a-1)//2 - a)

Buggy submission (verdict: Runtime Error):
a,b = int(input().split())
print((b-a)*(b-a-1)/2 - a)
Problem p03501 (python)

Fixed submission:
n,a,b = map(int, input().split(' '))
print(min(n*a,b))

Buggy submission (verdict: Runtime Error):
return min(N*A,B)
Problem p03795 (python)

Fixed submission:
a = int(input())
print( 800*a - 200*(a//15) )

Buggy submission (verdict: Runtime Error):
print( 800*int(input()) - 200*(int(input()) // 15))
Problem p03826 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c,d = input().split()
print(max(a*b,c*d))
Problem p03841 (python)

Fixed submission:
n = int(input())
x = [int(x) for i, x in enumerate(input().split())]
x = sorted(zip(x, range(1, n+1)))

stack = []
for v, i in x[::-1]:
    for _ in range(i-1):
        stack.append(i)

cur = 1
ans = []
res = []
cnt = [0]*(n+1)
for i in range(n):
    for _ in range(x[i][0]-cur):
        if stack:
            nxt = stack.pop()
        elif res:
            nxt = res.pop()
        else:
            print('No')
            exit()
        ans.append(nxt)
        cnt[nxt] += 1
    if cnt[x[i][1]] != x[i][1]-1:
        print('No')
        exit()
    ans.append(x[i][1])
    for _ in range(n-x[i][1]):
        res.append(x[i][1])
    cur = x[i][0]+1

ans += res

print('Yes')
print(*ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
x = [int(x)-i-1 for i, x in enumerate(input().split())]
x = sorted(zip(x, range(1, n+1)))

stack = []
for v, i in x[::-1]:
    for _ in range(i-1):
        stack.append(i)

cur = 0
ans = []
res = []
cnt = [0]*(n+1)
for i in range(n):
    for _ in range(x[i][0]-cur):
        if stack:
            nxt = stack.pop()
        elif res:
            nxt = res.pop()
        else:
            print('No')
            exit()
        ans.append(nxt)
        cnt[nxt] += 1
    if cnt[x[i][1]] < x[i][1]-1:
        print('No')
        exit()
    ans.append(x[i][1])
    for _ in range(n-x[i][1]):
        res.append(x[i][1])
    cur += x[i][0]

for v, i in x:
    if ans[v+i-1] != i:
        print('No')
        exit()

print('Yes')
print(*ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
x = [int(x)-i-1 for i, x in enumerate(input().split())]
x = sorted(zip(x, range(1, n+1)))

stack = []
for v, i in x[::-1]:
    for _ in range(i-1):
        stack.append(i)

cur = 0
ans = []
res = []
cnt = [0]*(n+1)
for i in range(n):
    for _ in range(x[i][0]-cur):
        if stack:
            nxt = stack.pop()
        else:
            nxt = res.pop()
        ans.append(nxt)
        cnt[nxt] += 1
    if cnt[x[i][1]] < x[i][1]-1:
        print('No')
        exit()
    ans.append(x[i][1])
    for _ in range(n-x[i][1]):
        res.append(x[i][1])
    cur += x[i][0]

print('Yes')
print(*ans)
Problem p03844 (python)

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

if a[1] == "+":
  print(int(a[0]) + int(a[2]))
else:
  print(int(a[0]) - int(a[2]))

Buggy submission (verdict: Runtime Error):
N = int(input())
test = list(map(int,input().split()))
M = int(input()) 
  
for _ in range(M):
  a,b = map(int,input().split())
  print(sum(test) - test[a] + b)

Buggy submission (verdict: Runtime Error):
N = int(input())
test = list(map(int,input().split()))
M = int(input()) 
  
for _ in range(M):
  a,b = int(input()).split()
  test[a] = b
  print(sum(test))

Buggy submission (verdict: Runtime Error):
N = input()
test = list(map(int,input()))
M = input() 
  
for _ in range(M):
  a,b = int(input()).split()
  test[a] = b
  print(sum(test))

Buggy submission (verdict: Runtime Error):
a = input().split()
return int(a[0]) + int(a[2]) if a[1] == "+" else int(a[0]) - int(a[2])

Buggy submission (verdict: Runtime Error):
a = input().split("")
return int(a[0]) + int(a[2]) if a[1] == "+" else int(a[0]) - int(a[2])
Problem p03845 (python)

Fixed submission:
N = int(input())
test = list(map(int,input().split()))
M = int(input()) 
  
for _ in range(M):
  a,b = map(int,input().split())
  print(sum(test) - test[a-1] + b)

Buggy submission (verdict: Runtime Error):
N = int(input())
test = list(map(int,input().split()))
M = int(input()) 
  
for _ in range(M):
  a,b = map(int,input().split())
  print(sum(test) - test[a] + b)

Buggy submission (verdict: Runtime Error):
N = int(input())
test = list(map(int,input().split()))
M = int(input()) 
  
for _ in range(M):
  a,b = map(int,input().split())
  test[a] = b
  print(sum(test))

Buggy submission (verdict: Runtime Error):
N = int(input())
test = list(map(int,input().split()))
M = int(input()) 
  
for _ in range(M):
  a,b = int(input()).split()
  test[a] = b
  print(sum(test))

Buggy submission (verdict: Runtime Error):
N = input()
test = list(map(int,input().split()))
M = input() 
  
for _ in range(M):
  a,b = int(input()).split()
  test[a] = b
  print(sum(test))

Buggy submission (verdict: Runtime Error):
N = input()
test = list(map(int,input()))
M = input() 
  
for _ in range(M):
  a,b = int(input()).split()
  test[a] = b
  print(sum(test))

Buggy submission (verdict: Runtime Error):
N = input()
test = list(map(int,input()))

for _ in range(input()):
  a,b = int(input()).split()
  test[a] = b
  print(sum(test))
Problem p03964 (python)

Fixed submission:
n = int(input())
from math import ceil

tkhs = 1
aoki = 1

for _ in range(n):
    t, a = map(int, input().split())
    k = max((tkhs+t-1)//t, (aoki+a-1)//a)
    tkhs = k*t
    aoki = k*a

print(tkhs+aoki)

Buggy submission (verdict: Runtime Error):
n = int(input())
from math import ceil, gcd

tkhs = 1
aoki = 1

for _ in range(n):
    t, a = map(int, input().split())
    t, a = t // gcd(t,a), a // gcd(t,a)
    k = max(ceil(tkhs/t), ceil(aoki/a))
    tkhs = k*t
    aoki = k*a

print(tkhs+aoki)
Problem p04014 (python)

Fixed submission:
n = int(input())
s = int(input())

import math

ans = float('inf')

if s == n:
    print(n+1)
    exit()

for b in range(2, 10**6):
    res = n
    tmp = 0
    while res > 0:
        tmp += res % b
        res = (res-res % b)//b
    if tmp == s:
        ans = min(ans, b)

if n < 10**6:
    print(ans if ans != float('inf') else -1)
    exit()

for p in range(1, 10**6):
    if (n-s) % p != 0:
        continue
    else:
        b = (n-s)//p + 1
        if b > math.sqrt(n) and n % b == s-p:
            ans = min(ans, b)
        
print(ans if ans != float('inf') else -1)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = int(input())

ans = float('inf')

for b in range(2, 10**6):
    res = n
    tmp = 0
    while res > 0:
        tmp += res % b
        res = (res-res % b)//b
    if tmp == s:
        ans = min(ans, b)

if n < 10**6:
    print(ans if ans != float('inf') else -1)
    exit()

for p in range(1, 10**6):
    if (n-s) % p != 0:
        continue
    else:
        b = (n-s)//p + 1
        if n % b == s-p:
            ans = min(ans, b)
        
print(ans if ans != float('inf') else -1)
Problem p02718 (python)

Fixed submission:
import numpy as np

N, M = list(map(int, input().split()))
A = list(map(int, input().split()))

total_vote = np.sum(A)
threshold = total_vote/(4*M)
A.sort(reverse = True)
if A[M-1] >= threshold:
    print('Yes')
else:
    print('No')

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

N, M = list(map(int, input().split()))
A = list(map(int, input().split()))

total_vote = np.sum(A)
threshold = total_vote/(4*M)
A.sort(reverse = True)
if A[M] > threshold:
    print('Yes')
else:
    print('No')

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

N, M = list(map(int, input().split()))
A = list(map(int, input().split()))

total_vote = np.sum(A)
threshold = total_vote*(1/4*M)
A.sort(reverse = True)
if A[M] > threshold:
    print('Yes')
else:
    print('No')
Problem p02911 (python)

Fixed submission:
import numpy as np

N, K, Q=list(map(int,input().split()))
points = K * np.ones(N)
A_list = np.zeros(Q)

for i in range(Q):
    A = int(input()) - 1
    A_list[i] = A

points = points - Q
for i in A_list:
    points[int(i)] += 1

for i in range(N):
    if points[i] > 0:
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
N, K, Q=list(map(int,input().split()))
points = K * np.ones(N)
for i in range(Q):
    A = int(input()) - 1
    points -= 1
    points[A] += 1
for i in range(N):
    if points[i] > 0:
        print('Yes')
    else:
        print('No')
Problem p03071 (python)

Fixed submission:
import numpy as np
a,b=map(int, input().split())

if a>b:
  c=a+(a-1)
if a<b:
  c=b+(b-1)
if a==b:
  c=a+b
print(c)

Buggy submission (verdict: Runtime Error):
import numpy as np
a=int(input())
b=int(input())

if a>b:
  c=a+(a-1)
if a<b:
  c=b+(b-1)
if a==b:
  c=a+b
print(c)
Problem p03161 (python)

Fixed submission:
# B - Frog2
import numpy as np

N, K = list(map(int, input().split()))
h = np.array(list(map(int, input().split()))+[0]*K)

dp = np.array([10**9]*(N+K))
dp[0] = 0

for i in range(N):
    dp[i+1:i+K+1] = np.minimum(dp[i+1:i+K+1], dp[i]+abs(h[i+1:i+K+1]-h[i]))
print(dp[N-1])

Buggy submission (verdict: Runtime Error):
# B - Frog2
import numpy as np

N, K = list(map(int, input().split()))
h = list(map(int, input().split()))

dp = [10**9]*(N+K)
dp[0] = 0

for i in range(N):
    dp[i+1:i+K+1] = min(dp[i+1:i+K+1], dp[i]+abs(h[i+1:i+K+1]-h[i]))
print(dp[N-1])

Buggy submission (verdict: Runtime Error):
# B - Frog2
import numpy as np

N, K = list(map(int, input().split()))
h = list(map(int, input().split()))

dp = [10**9]*(N+K)
dp[0] = 0

for i in range(N):
    dp[i+1:i+K+1] = min(dp[i+1:i+K+1], dp[i]+abs(h[i+1:i+K+1]-h[i]))
print(dp[N-1])

Buggy submission (verdict: Runtime Error):
# B - Frog2
import numpy as np

N, K = list(map(int, input().split()))
h = list(map(int, input().split()))
dp = [10**9]*N

dp[0] = 0

for i in range(N-1):
    if i+K+1 <= N-1:
        for j in range(i+1, i+K+1):
            dp[j] = min(dp[j], dp[i]+abs(h[j]-h[i]))
    else:
        for j in range(i+1, N):
            dp[j] = min(dp[j], dp[i]+abs(h[j]-h[i]))
print(dp[N-1])

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

dp = [10 ** 9 for i in range(N + K)]
dp[0] = 0
for i in range(N):
    for j in range(1, K + 1):
        if i + j < N:
            dp[i + j] = min(dp[i + j], dp[i] + abs(h[i] - h[i + j]))

print(dp[N - 1])

Buggy submission (verdict: Runtime Error):
    N, K = map(int, input().split())
    h = list(map(int, input().split()))
     
    dp = [10 ** 9 for i in range(N + K)]
    dp[0] = 0
    for i in range(N):
        for j in range(1, K + 1):
            if i + j < N:
                dp[i + j] = min(dp[i + j], dp[i] + abs(h[i] - h[i + j]))
     
    print(dp[N - 1])