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

Fixed submission:
import math

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

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

answer = 0

for i in range(1, K+1):
    if N-K+1 < i:
        print(0)
        continue
    answer = combinations_count(K-1, i-1)
    answer *= combinations_count(N-K+1, i)
    answer %= 10**(9) + 7
    print(answer)

Buggy submission (verdict: Runtime Error):
import math

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

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

answer = 0

for i in range(1, K+1):
    answer = combinations_count(K-1, i-1)
    answer *= combinations_count(N-K+1, i)
    answer %= 10**(9) + 7
    print(answer)
Problem p03127 (python)

Fixed submission:
from fractions import gcd

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

sortedA = sorted(A)
answer = A[0]

for x in range(0,N):
        answer = gcd(answer,A[x])
        if answer == 1:
            break

print(answer)

Buggy submission (verdict: Runtime Error):
import fraction

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

sortedA = sorted(A)
answer = A[0]

for x in range(0,N):
        answer = gcd(answer,A[x])
        if answer == 1:
            break

print(answer)

Buggy submission (verdict: Runtime Error):
from fraction import gcd

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

sortedA = sorted(A)
answer = A[0]

for x in range(0,N):
        answer = gcd(answer,A[x])
        if answer == 1:
            break

print(answer)
Problem p02951 (python)

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

Buggy submission (verdict: Runtime Error):
s = input()
sl = len(s)
dp = {}
ct = [0] * sl
for x in range(sl):
    dp[(0, x)] = x - 1 if s[x] == 'L' else x + 1
for i in range(32):
    for j in range(sl):
        dp[(i + 1, j)] = dp[(i, dp[(i, j)])]
for x in range(sl): ct[dp[(32, x)]] += 1
print(' '.join([str(ct[x]) for x in range(sl)]))
Problem p02595 (python)

Fixed submission:
import math
L, M = map(int,input().split())
list1=[]
for i in range(L):
  X,Y = map(int,input().split())
  r = X**2+Y**2
  if r <= M**2:
    list1.append(r)
print(len(list1))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
P = [input().split() for i in range(M)]
print(type(P), P)
Problem p02948 (python)

Fixed submission:
from heapq import heappush,heappop
n,m=map(int,input().split())
li=[[]for i in range(10**5+1)]
for i in range(n):
    a,b=map(int,input().split())
    li[a].append(b)
li2=[]
#print(li)
ans=0
for i in range(1,m+1):
    for x in li[i]:
        heappush(li2,-x)
    if li2:
        ans+=heappop(li2)
    #print(li2)
   # print(ans)
print(-ans)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
l=[]
for i in range(n): 
    a,b=map(int,input().split())
    l.append([a,b])
    #b afer a days 
#l=[]
l=[l[i] for i in range(n) if l[i][0]<=m]
l.sort(key=lambda x:[-x[1],-x[0]])
#print(l)
sm=0 
day=0 
#print(l)
for i in range(n): 
    #print(day,l[i][0],l[i][1])
    if day+l[i][0]<=m: 
        sm+=l[i][1]
        #print(i,sm)
        day+=1 
    else: 
        pass 
print(sm)
Problem p03806 (python)

Fixed submission:
def main():
    n,ma,mb = map(int,input().split())
    dp = [[[float("inf") for _ in range(401)] for _ in range(401)] for _ in range(n+1)]
    dp[0][0][0]=0

    for i in range(1,n+1):
        a,b,c = map(int,input().split())
        for j in range(401):
            for k in range(401):
                if a<=j and b<=k:
                    dp[i][j][k] = min(dp[i-1][j][k],dp[i-1][j-a][k-b]+c)
                else:
                    dp[i][j][k] = dp[i-1][j][k]
    ans = float("inf")
    for i in range(1,401):
        for j in range(1,401):
            if i*mb == j*ma:
                ans = min(ans,dp[n][i][j])
    if ans==float("inf"):
        print(-1)
    else:
        print(ans)
if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
n,ma,mb=map(int,input().split())
dp=[[10**9 for j in range(400)]for i in range(400)]
dp[0][0]=0 
for i in range(n):
    a,b,c=map(int,input().split())
    for x in range(400):
        for y in range(400):
            if x<a or y<b:
                continue 
            dp[x][y]=min(dp[x][y],dp[x-a][y-b]+c)
mini=10**9 
for i in range(1,41):
    mini=min(mini,dp[ma*i][mb*i])
if mini>=10**9:
    print(-1)
else:
    print(mini)

Buggy submission (verdict: Runtime Error):
n,ma,mb=map(int,input().split())
dp=[[10**9 for j in range(400)]for i in range(400)]
dp[0][0]=0 
for i in range(n):
    a,b,c=map(int,input().split())
    for x in range(400):
        for y in range(400):
            if x<a or y<b:
                continue 
            dp[x][y]=min(dp[x][y],dp[x-a][y-b]+c)
mini=10**9 
for i in range(1,41):
    mini=min(mini,dp[ma*i][mb*i])
if mini>=10**9:
    print(-1)
else:
    print(mini)
Problem p02820 (python)

Fixed submission:
import sys
sys.setrecursionlimit(2147483647)
n, k = map(int, input().split())
r, s, p = map(int, input().split())
t = list(input())
for i in range(n-k):
    if t[i] == t[i+k]:
        t[i+k] = "d"

t = "".join(t)
t = t.replace("r", "{}+".format(p)).replace("p", "{}+".format(s)).replace("s", "{}+".format(r)).replace("d", "0+") + "0"
print(eval(t))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
r, s, p = map(int, input().split())
t = list(input())
for i in range(n-k):
    if t[i] == t[i+k]:
        t[i+k] = "d"

t = "".join(t)
t = t.replace("r", "{}+".format(p)).replace("p", "{}+".format(s)).replace("s", "{}+".format(r)).replace("d", "0+") + "0"
print(eval(t))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
r, s, p = map(int, input().split())
t = list(input())
for i in range(len(t)-k):
    if t[i] == t[i+k]:
        t[i+k] = "d"

t = "".join(t)
t = t.replace("r", "{}+".format(p)).replace("p", "{}+".format(s)).replace("s", "{}+".format(r)).replace("d", "0+") + "0"
print(eval(t))
Problem p02970 (python)

Fixed submission:
import math
n, d = map(int,input().split())
print(math.ceil(n / (2 * d + 1)))

Buggy submission (verdict: Runtime Error):
import mth
n, d = map(int,input().split())
print(math.ceil(n / (2 * d + 1)))

Buggy submission (verdict: Runtime Error):
import mth
n, d = map(int,input().split())
print(math.seil(n / (2 * d + 1)))
Problem p02863 (python)

Fixed submission:
n, t = map(int, input().split())
a, b = [0] * n, [0] * n
for i in range(n):
  a[i], b[i] = map(int, input().split())

dp = [[[0] * (t+1) for i in range(n+1)] for j in range(2)]
for i in range(n):
  for d in range(2):
    for l in range(1,t+1):
      if(l < a[i]):
        dp[d][i+1][l] = max(dp[d][i][l], d*(b[i]+dp[0][i][l-1]))
      else:
        dp[d][i+1][l] = max(dp[d][i][l], b[i]+dp[d][i][l-a[i]], d*(b[i]+dp[0][i][l-1]))

print(dp[1][n][t])

Buggy submission (verdict: Runtime Error):
n, t = map(int, input().split())
d0, d1 = [0] * (t+1), [0] * (t+1)
for i in range(n):
  a, b = map(int, input().split())
  for l in range(t,a-1,-1):
    d0[l] = max(d0[l], b+d0[l-a])
    d1[l] = max(d1[l], b+d1[l-a], b+d0[l-1])
  for l in range(a-1,0,-1):
    d1[l] = max(d1[l], b+d0[l-1])
print(d1[t])

Buggy submission (verdict: Runtime Error):
n, t = map(int, input().split())
a, b = [0] * n, [0] * n
for i in range(n):
  a[i], b[i] = map(int, input().split())

dp = [[-1] * (t+1) for i in [0] * n]
def dfs(i, l):
  if(i == n or l <= 0):
    return 0
  elif(dp[i][l] != -1):
    return dp[i][l]
  else:
    dp[i][l] = max(b[i] + dfs(i+1, l - a[i]), dfs(i+1, l))
    return dp[i][l]

print(dfs(0, t))
Problem p03127 (python)

Fixed submission:
import numpy as np
from functools import reduce

def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)


N = input()
A = list(map(int, input().split()))
print(reduce(gcd, A, A[0]))

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

N = input()
A = np.fromiter(map(int, input().split()), dtype=np.int64)
print(np.gcd.reduce(A))
Problem p02990 (python)

Fixed submission:
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 10**4
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )


N,K = map(int,input().split())
for i in range(1,1+K):
    ans = cmb(1+N-K,i,mod)
    ans *= cmb(K-1,K-i,mod)
    print(ans%mod)

Buggy submission (verdict: Runtime Error):
from operator import mul
from functools import reduce
MOD = 10 ** 9 + 7
def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom 
N,K = map(int,input().split())
for i in range(1,1+K):
    ans = combinations_count(1+N-K,i)  % MOD
    ans *= combinations_count(K-1,k-i) % MOD
    print(ans%MOD)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
path = [[] for _ in range(N*3+3)]
for _ in range(M):
    u,v = map(int,input().split())
    path[u].append(v+N)
    path[u+N].append(v+N+N)
    path[u+N+N].append(v)

S,T = map(int,input().split())
import collections

q = collections.deque()
vis = [-1 for _ in range(N*3+3)]
def bfs():
    while len(q) > 0:
        now,cnt = q.popleft()
        #print(now,T,cnt,path[now],q)
        vis[now] = cnt
        if now == T: 
            return cnt
        for x in path[now]:
            if vis[x] == -1:
                q.append((x,cnt+1))
vis[S] = 1
q.append([S,0])
ans = bfs()
if vis[T] == -1: print(-1)
else: print(ans//3)
Problem p03127 (python)

Fixed submission:
N = int(input())
L = list(map(int,input().split()))
while True:
  if len(L) == 1:
    print(L[0])
    quit()
  L = sorted(L)
  m = L[0]
  for i in range(1,len(L)):
    L[i] %= m
  L = list(filter(lambda x:x!=0,L))

Buggy submission (verdict: Runtime Error):
N = int(input())
L = list(map(int,inptut().split()))
while True:
  if len(L) == 1:
    print(L[0])
    quit()
  L = sorted(L)
  m = L[0]
  for i in range(1,len(L)):
    L[i] %= m
  L = list(filter(lambda x:x!=0,L))
Problem p03137 (python)

Fixed submission:
N, M = map(int,input().split())
L = sorted(list(map(int,input().split())))
distance = []
for i in range(len(L)-1):
    distance.append(abs(L[i]-L[i+1]))
distance = sorted(distance)
for _ in range(N-1):
    try:
        del distance[-1]
    except:
        print(0)
        quit()
print(sum(distance))

Buggy submission (verdict: Runtime Error):
diN, M = map(int,input().split())
L = sorted(list(map(int,input().split())))
distance = []
for i in range(len(L)-1):
    distance.append(abs(L[i]-L[i+1]))
distance = sorted(distance)
for _ in range(N-1):
    if len(distance) > 0:
        del distance[-1]
    else:
        print(0)
        quit()
print(sum(distance))
Problem p03207 (python)

Fixed submission:
N=int(input())
L=[int(input()) for _ in range(N)]

ans=sum(L)-max(L)/2
print(int(ans))

Buggy submission (verdict: Runtime Error):
#include <stdio.h>
#include <string.h>
#include <math.h>

int main(void){
        int N = 0;
        scanf("%d", &N);
        int l[N];
        for (int i = 0; i < N; i++) {
                        scanf("%d", &l[i]);
        }
        int tmp = -1;
        int sum = 0;
        for (int i = 0; i < N; i++) {
                        if (tmp < l[i]) tmp = l[i];sum += l[i];
        }
        printf("%d\n",sum - tmp / 2);
//      for (int i = 0; i < N; i++) {
//                      printf("%d\n",l[i]);
//      }
        return 0;
}
Problem p03221 (python)

Fixed submission:
N,M = map(int,input().split())
L = []
for i in range(M):
    l = list(map(int,input().split()))+[i]
    L.append(l)
cnt = 0
tmp = []
M = sorted(L,key = lambda x: (x[0],x[1]))
for x in M:
    if tmp == x[0]:
        x.append(cnt+1)
        cnt += 1
    else:
        tmp = x[0]
        cnt = 0
        x.append(cnt)
M = sorted(L,key = lambda x:x[2])
#print(M)
for x in M:
    st = str(x[0]).zfill(6)
    st += str(x[3]+1).zfill(6)
    print(st)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
N,M=map(int, input().split())
L=[ [] for _ in range(N)]

X=[]
for _ in range(M):
    a,b = input().split()
    a=int(a)
    b=int(b)
    L[a-1].append(b)
    X.append({a:b})
Y=[ (sorted(L[_])) for _ in range(N) ]
for i in range(M) :
    for k,v in X[i].items():
        z='%06d' % 
        Z='%06d' % k
        print('%06d%06d' % (k,(Y[k-1].index(v)+1)))
Problem p03272 (python)

Fixed submission:
N,i = map(int,input().split())
print(N-i+1)

Buggy submission (verdict: Runtime Error):
N,i = int(input().split())
print(N-i+1)
Problem p03315 (python)

Fixed submission:

a=input()
sum=0
for x in a:
    if x=="+":
        sum+=1

print((sum-2)*2)

Buggy submission (verdict: Runtime Error):
serch_table = []

for i in range(100):
    for j in range(1,1000):
        x = str(j) + '9'*i
        x = int(x)
        serch_table.append(x)
#print(serch_table)

L = []
for i in serch_table:
    l = [x for x in str(i)]
    x = sum(map(int,l))
    l = [i/x,i]
    L.append(l)
L= sorted(L)
M = []
tmp = -1
for i in L:
    if tmp < i[1]:
        M.append(i[1])
        tmp = i[1]
#print(M,len(serch_table ))
N = int(input())
for i in range(N):
    print(M[i])
Problem p03774 (python)

Fixed submission:
N, M = map(int,input().split())
students = []
for _ in range(N):
    l = list(map(int,input().split()))
    students.append(l)

check_points = []

for _ in range(M):
    l = list(map(int,input().split()))
    check_points.append(l)

minimum_points = 0

for person in students:
    minimum = 10**10
    for i in range(len(check_points)):
        d=abs(person[0]-check_points[i][0])+abs(person[1]-check_points[i][1])
        if minimum > d:
            minimum = d
            minimum_points = i
    print(minimum_points+1)

Buggy submission (verdict: Runtime Error):
students = []
for _ in range(N):
    l = list(map(int,input().split()))
    students.append(l)

check_points = []

for _ in range(M):
    l = list(map(int,input().split()))
    check_points.append(l)

minimum_points = 0

for person in students:
    minimum = 10**10
    for i in range(len(check_points)):
        d=abs(person[0]-check_points[i][0])+abs(person[1]-check_points[i][1])
        if minimum > d:
            minimum = d
            minimum_points = i
    print(minimum_points+1)
Problem p03775 (python)

Fixed submission:
N = int(input())
for i in range(1,1+int(N**(1/2))):
    if N % i == 0:
        tmp = i
print(max(len(str(N // tmp)),len(str(tmp))))

Buggy submission (verdict: Runtime Error):
N = int(input())
an = 10**10
for i in range(1,1+int(N)):
    if N % i == 0:
        tmp = i
        s = max(len(str(N // tmp)),len(str(tmp)))
        ans = min(ans,s)
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
for i in range(1,1+int(N)):
    if N % i == 0:
        tmp = i
s = max(len(str(N // tmp)),len(str(tmp)))
ans = min(ans,s)
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
for i in range(1,1+int(N)):
    if N % i == 0:
        tmp = i
s = max(len(str(N // tmp)),len(str(tmp)))
ans = min(ans,s)
Problem p03803 (python)

Fixed submission:
table=[2,3,4,5,6,7,8,9,10,11,12,13,1]
a,b=map(int,input().split())
if a == b :
    print("Draw")
elif table.index(a) < table.index(b):
    print("Bob")
elif table.index(a) > table.index(b):
    print("Alice")

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
L=[]
S=[]
for i in range(N):
    x = input()
    l=[y for y in x]
    L.append(l)
for i in range(M):
    x = input()
    s=[y for y in x]
    S.append(s)
flag = 0
sum = 0
for i in range(N):
    for j in range(N):
        for k in range(M):
            for l in range(M):
                if i+k < N and j+l < N:
                    if L[i+k][j+l] == S[k][l]:
                        sum += 1
                        if sum == M * M:
                            flag = 1
                    else:
                        sum = 0
if flag == 0:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
L=[]
S=[]
for i in range(N):
    x = input()
    l=[y for y in x]
    L.append(l)
for i in range(M):
    x = input()
    s=[y for y in x]
    S.append(s)
flag = 0
sum = 0
for i in range(N):
    for j in range(N):
        for k in range(M):
            for l in range(M):
                if i+k < N and j+l < N:
                    if L[i+k][j+l] == S[k][l]:
                        sum += 1
                        if sum == M * M:
                            flag = 1
                    else:
                        sum = 0
if flag == 0:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
L=[]
S=[]
for i in range(N):
    x = input()
    l=[y for y in x]
    L.append(l)
for i in range(M):
    x = input()
    s=[y for y in x]
    S.append(s)
flag = 0
sum = 0
for i in range(N):
    for j in range(N):
        for k in range(M):
            for l in range(M):
                if i+k < N and j+l < N:
                    if L[i+k][j+l] == S[k][l]:
                        sum += 1
                        if sum == M * M:
                            flag = 1
                    else:
                        sum = 0
if flag == 0:
    print("No")
else:
    print("Yes")
remote@deb465:~/pyt
Problem p02781 (python)

Fixed submission:
from collections import Counter
N=input()
K=int(input())
km = len(N)
res = 0
if int(N)<=1000:
    for i in range(int(N)):
        c = Counter(str(i+1))
        if len(str(i+1)) - c['0']==K:
            res += 1
    print(res)
    exit()
d = [[0]*3 for _ in range(100001)]
for i in range(100000):
    d[i+1] = d[i][:]
    c = Counter(str(i+1))
    k=len(str(i+1)) - c['0']
    if k<=3:
        d[i+1][k-1] += 1
def rec(n,k):
    re = 0
    if int(n)<100000:
        re = 0
        return d[int(n)][k-1]
    if k==1:
        n = str(int(n))
        return 9*(len(n)-1)+int(n[0])
    t = ''.join(['9']*(len(n)-1))
    t2 = t
    w = (int(n[0])-1)
    if n[0] == '0':
        t2 = n[1:]
        w = 0
    return rec(t2, k) + w*rec(t2, k-1) + rec(str(int(n[1:])), k-1)
print(rec(N,K))

Buggy submission (verdict: Runtime Error):
from collections import Counter
N=input()
K=int(input())
res = 0
if int(N)<=100:
    for i in range(int(N)):
        c = Counter(str(i+1))
        if len(str(i+1)) - c['0']==K:
            res += 1
    print(res)
    exit()
else:
    for i in range(1,100):
        c = Counter(str(i))
        k = len(str(i)) - c['0']
        dic[str(k)] += 1
def rec(n,k):
    re = 0
    if int(n)<=1000:
        re = 0
        for i in range(int(n)):
            c = Counter(str(i+1))
            if len(str(i+1)) - c['0']==k:
                re += 1
        return re
    if k==1:
        return 9*(len(n)-1)+int(n[0])
    t = ''.join(['9']*(len(n)-1))
    return rec(t, k) + (int(n[0])-1)*rec(t, k-1) + rec(n[1:], k-1)
print(rec(N,K))
Problem p02793 (python)

Fixed submission:
import fractions
import sys
input = sys.stdin.readline
N = int(input())
a = list(map(int,input().split()))
g = 1
res = 0
MOD = 10**9+7
for elem in a:
    tmp = g*elem//fractions.gcd(g,elem)
    res *= tmp//g
    g = tmp
    res += g//elem
print(res%MOD)

Buggy submission (verdict: Runtime Error):
def main():
    import fractions
    import sys
    input = sys.stdin.readline
    N = int(input())
    a = tuple(map(int,input().split()))
    g = a[0]
    MOD = 10**9+7
    for i in range(1,N):
        t = a[i]
        #g = g*a[i]//fractions.gcd(g,a[i])
        g = divmod(g*t,fractions.gcd(g,t))[0]
    assert()
    res = 0
    for i in range(N):
        res += divmod(g,a[i])[1]
        res += (g//a[i])%MOD
    print(res%MOD)
if __name__ == '__main__':
    main()
Problem p02863 (python)

Fixed submission:
#import numpy as np

def knapsack2(N,W,weight,value,WW):
  #初期化
  inf=float("inf")
  dp=[[-inf for i in range(WW)] for j in range(N+1)]
  for i in range(WW):
      dp[0][i]=0
  maxval = 0
  #DP
  for i in range(N):
    for w in range(WW):
      if weight[i]<=w:
        if w-weight[i]>=W: #時間切れ
          dp[i+1][w]=dp[i][w]
        else: #注文可能
          dp[i+1][w]=max(dp[i][w-weight[i]]+value[i], dp[i][w])
      else: #NG
        dp[i+1][w]=dp[i][w]
    maxval = max([maxval, max(dp[i+1])])
#  for elem in dp:
#    print(elem[:2*W])
  return maxval
  #return np.max(np.array(dp))
  #return dp[N][2*W]

N, T = map(int,input().split())
WW = T+3000
ab = []
for i in range(N):
    ab.append(tuple(map(int,input().split())))

ab =  sorted(ab,key=lambda x:x[0])

weight = [elem[0] for elem in ab]
value = [elem[1] for elem in ab]
res = knapsack2(N,T,weight,value,WW)
print(res)

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

def knapsack2(N,W,weight,value,WW):
  #初期化
  inf=float("inf")
  dp=[[-inf for i in range(WW)] for j in range(N+1)]
  for i in range(WW):
      dp[0][i]=0

  #DP
  for i in range(N):
    for w in range(WW):
      if weight[i]<=w:
        if w-weight[i]>=W: #時間切れ
          dp[i+1][w]=dp[i][w]
        else: #注文可能
          dp[i+1][w]=max(dp[i][w-weight[i]]+value[i], dp[i][w])
      else: #NG
        dp[i+1][w]=dp[i][w]
  return np.max(np.array(dp))
  #return dp[N][2*W]

N, T = map(int,input().split())
WW = T+3000
ab = []
for i in range(N):
    ab.append(tuple(map(int,input().split())))

weight = [elem[0] for elem in ab]
value = [elem[1] for elem in ab]
res = knapsack2(N,T,weight,value,WW)
print(res)
Problem p02915 (python)

Fixed submission:
print(int(input()) ** 3)

Buggy submission (verdict: Runtime Error):
print(int(input) ** 3)
Problem p02990 (python)

Fixed submission:
import sys
input = sys.stdin.readline
from scipy.misc import comb

N, K = map(int,input().split())
MOD = 10**9+7
for i in range(1,K+1):
    if i==1 and N==K:
        print(1)
        continue
    val1 = comb(K-1, i-1, exact=True)%MOD
    val2 = comb(N-K-1, i, exact=True)%MOD
    val3 = comb(N-K-1, i-1, exact=True)%MOD
    val4 = comb(N-K-1, i-2, exact=True)%MOD
    res = (val1*(val2+2*val3+val4))%MOD
    print(res)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
from scipy.special import comb

N, K = map(int,input().split())
MOD = 10**9+7
for i in range(1,K+1):
    val1 = comb(K-1, i-1, exact=True)%MOD
    val2 = comb(N-K-1, i, exact=True)%MOD
    val3 = comb(N-K-1, i-1, exact=True)%MOD
    val4 = comb(N-K-1, i-2, exact=True)%MOD
    print((val1*(val2+2*val3+val4))%MOD)