s_id stringlengths 10 10 | p_id stringlengths 6 6 | u_id stringlengths 10 10 | date stringlengths 10 10 | language stringclasses 1
value | original_language stringclasses 11
values | filename_ext stringclasses 1
value | status stringclasses 1
value | cpu_time stringlengths 1 5 | memory stringlengths 1 7 | code_size stringlengths 1 6 | code stringlengths 1 539k |
|---|---|---|---|---|---|---|---|---|---|---|---|
s337078976 | p03806 | u557494880 | 1580006105 | Python | Python (3.4.3) | py | Runtime Error | 349 | 56180 | 635 | N,Ma,Mb = map(int,input().split())
dp = [[[10**9 for i in range(400)] for j in range(400)] for k 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 j < a:
d[i][j][k] = d[i-1][j][k]
el... |
s743194382 | p03806 | u404290207 | 1579799012 | Python | PyPy3 (2.4.0) | py | Runtime Error | 167 | 38256 | 713 | w=int(input())
n,k=map(int,input().split())
arr=[]
for _ in range(n):
a,b=map(int,input().split())
arr.append([a,b])
mat=[[[0]*(w+1) for _ in range(k+1)] for _ in range(n+1)]
#W:全体の幅 N:枚数制約 K:重要度 A:スクショの幅 B:スクショの重要度
#全体の幅と枚数を制約として可能な限り重要度の合計を高くする
for num in range(1,n+1):
for kn in range(1,k+1):
... |
s265207149 | p03806 | u121921603 | 1579050399 | Python | PyPy3 (2.4.0) | py | Runtime Error | 233 | 115804 | 529 | import sys
input = sys.stdin.readline
n,ma,mb=map(int,input().split())
dp=[[[float("inf")]*500 for _ in range(500)] for i in range(n+1)]
dp[0][0][0]=0
for i in range(n):
a,b,c=map(int,input().split())
for j in range(450):
dp[i+1][j][k]=min(dp[i+1][j][k],dp[i][j][k])
for k in range(450):
... |
s359620115 | p03806 | u940139461 | 1578276821 | Python | Python (3.4.3) | py | Runtime Error | 1899 | 3956 | 768 | N, A, B = map(int, input().split())
items = []
A_MAX = 0
B_MAX = 0
for _ in range(N):
a, b, cost = map(int, input().split())
items.append((a, b, cost))
A_MAX += a
B_MAX += b
dp = [[float('infinity')] * (A_MAX + 1) for _ in range(B_MAX + 1)]
dp[0][0] = 0
for a, b, cost in items:
for i in range(B_... |
s884204910 | p03806 | u940139461 | 1578276275 | Python | Python (3.4.3) | py | Runtime Error | 1786 | 4720 | 844 | N, A, B = map(int, input().split())
items = []
A_MAX = 0
B_MAX = 0
for _ in range(N):
a, b, cost = map(int, input().split())
items.append((a, b, cost))
A_MAX += a
B_MAX += b
A_MAX = int(A_MAX)
B_MAX = int(B_MAX)
dp = [[float('infinity')] * (A_MAX + 1) for _ in range(B_MAX + 1)]
dp[0][0] = 0
for a, b... |
s491658916 | p03806 | u940139461 | 1578115371 | Python | PyPy3 (2.4.0) | py | Runtime Error | 402 | 53724 | 844 | N, A, B = map(int, input().split())
items = []
A_MAX = 0
B_MAX = 0
MAX_cost = 0
for _ in range(N):
a, b, cost = map(int, input().split())
items.append((a, b, cost))
A_MAX += a
B_MAX += b
MAX_cost += cost
dp = [[float('infinity')] * (A_MAX + 1) for _ in range(B_MAX + 1)]
dp[0][0] = 0
for a, b, cos... |
s891008687 | p03806 | u940139461 | 1578114705 | Python | Python (3.4.3) | py | Runtime Error | 1604 | 4712 | 826 | N, A, B = map(int, input().split())
items = []
A_MAX = 0
B_MAX = 0
MAX_cost = 0
for _ in range(N):
a, b, cost = map(int, input().split())
items.append((a, b, cost))
A_MAX += a
B_MAX += b
MAX_cost += cost
dp = [[float('infinity')] * (A_MAX + 1) for _ in range(B_MAX + 1)]
# dp[0][0] = 0
for a, b, c... |
s337616510 | p03806 | u940139461 | 1578114048 | Python | Python (3.4.3) | py | Runtime Error | 1672 | 4724 | 820 | N, A, B = map(int, input().split())
items = []
A_MAX = 0
B_MAX = 0
MAX_cost = 0
for _ in range(N):
a, b, cost = map(int, input().split())
items.append((a, b, cost))
A_MAX += a
B_MAX += b
MAX_cost += cost
dp = [[float('infinity')] * (A_MAX + 1) for _ in range(B_MAX + 1)]
# dp[0][0] = 0
for a, b, c... |
s807137464 | p03806 | u254871849 | 1576735127 | Python | Python (3.4.3) | py | Runtime Error | 2124 | 270020 | 1050 | import sys
import numpy as np
from copy import deepcopy
I = np.array(sys.stdin.read().split(), dtype=np.int64)
n, ma, mb = I[:3]
a, b, c = I[3:].reshape(n, 3).T
def main():
sa = np.sum(a)
sb = np.sum(b)
res = [[[[0, 0] for _ in range(sb+1)] for _ in range(sb + 1)] for _ in range(n+1)]
res[0][0][0][0]... |
s261105014 | p03806 | u150603590 | 1576382259 | Python | PyPy3 (2.4.0) | py | Runtime Error | 167 | 38640 | 928 | import numpy
if __name__ == '__main__':
N,M_a,M_b=list(map(int,input().split()))
A,B,C=[],[],[]
for i in range(N):
a,b,c=list(map(int,input().split()))
A.append(a)
B.append(b)
C.append(c)
dp=[[[1e10 for i in range(max(B)*(N+1))] for j in range(max(A)*(N+1))] for k in ra... |
s016229815 | p03806 | u470542271 | 1576207607 | Python | Python (3.4.3) | py | Runtime Error | 210 | 5812 | 1068 | n, ma, mb = map(int, input().split())
abc = [list(map(int, input().split())) for _ in range(n)]
m = n * 10 + 1
dp1 = [[float('inf')] * m for i in range(n + 1)]
for i in range(n + 1):
dp1[i][0] = 0
for i in range(n):
for j in range(m):
dp1[i+1][j] = min(dp1[i+1][j], dp1[i][j])
# i個目を買う
... |
s431241027 | p03806 | u780475861 | 1575856172 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 427 | n, ma, mb = [int(i) for i in input().split()]
lst = [[int(i) for i in input().split()] for _ in range(n)]
lst.sort(key=lambda x: x[2])
def push(k,v):
if k in dic:
dic[k] = min(dic[k],v)
else:
dic[k] = v
for i in lst:
k, v = i[0] * mb - i[1] * ma, i[2]
l = [[j, dic[j]] for j in dic]
... |
s430705556 | p03806 | u682985065 | 1574133034 | Python | Python (3.4.3) | py | Runtime Error | 430 | 11632 | 644 | n, ma, mb = map(int, input().split())
a, b, c = [0]*n, [0]*n, [0]*n
for i in range(n):
a[i], b[i], c[i] = map(int, input().split())
dp = [[float('inf')] * (sum(a)+1) for _ in range(sum(b)+1)]
dp[0][0] = 0
step = [(0, 0)]
for i in range(n):
ai, bi = a[i], b[i]
s = step.copy()
for si in s:
i... |
s096758604 | p03806 | u970197315 | 1572321785 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 19 | print(oteagedesita) |
s378434335 | p03806 | u593590006 | 1571536927 | Python | PyPy3 (2.4.0) | py | Runtime Error | 347 | 45676 | 427 | 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
... |
s929007479 | p03806 | u593590006 | 1571536901 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 8432 | 427 | 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
... |
s225839042 | p03806 | u760767494 | 1569546500 | Python | Python (3.4.3) | py | Runtime Error | 2137 | 1788616 | 756 | import numpy as np
N, Ma, Mb = map(int, input().split())
l = []
for i in range(N):
l.append(list(map(int, input().split())))
ans = 4001
dp = np.full((N + 1, 100 * N, 100 * N), 4001)
dp[0][0][0] = 0
for n in range(N):
for a in range(10 * N):
for b in range(10 * N):
if dp[n][a][b] == 4001:
... |
s822218268 | p03806 | u760767494 | 1569546466 | Python | PyPy3 (2.4.0) | py | Runtime Error | 167 | 38384 | 756 | import numpy as np
N, Ma, Mb = map(int, input().split())
l = []
for i in range(N):
l.append(list(map(int, input().split())))
ans = 4001
dp = np.full((N + 1, 100 * N, 100 * N), 4001)
dp[0][0][0] = 0
for n in range(N):
for a in range(10 * N):
for b in range(10 * N):
if dp[n][a][b] == 4001:
... |
s608706633 | p03806 | u760767494 | 1569546193 | Python | Python (3.4.3) | py | Runtime Error | 2134 | 1788644 | 756 | import numpy as np
N, Ma, Mb = map(int, input().split())
l = []
for i in range(N):
l.append(list(map(int, input().split())))
ans = 4001
dp = np.full((N + 1, 100 * N, 100 * N), 4001)
dp[0][0][0] = 0
for n in range(N):
for a in range(10 * N):
for b in range(10 * N):
if dp[n][a][b] == 4001:
... |
s223908551 | p03806 | u350248178 | 1567153629 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2125 | 501184 | 616 | n,ma,mb=map(int,input().split())
abc=[]
for i in range(n):
abc.append([int(j) for j in input().split()])
from operator import itemgetter
abc.sort(key=itemgetter(2))
dp=[[10**100 for i in range(401)]for j in range(401)]
dp[0][0]=0
from collections import deque
q=deque([(0,0)])
p=0
for a,b,c in abc:
l=[]
wh... |
s464404301 | p03806 | u585704797 | 1566676007 | Python | PyPy3 (2.4.0) | py | Runtime Error | 181 | 38896 | 782 | n,a,b=[int(x) for x in str(input()).split()]
A=[]
for i in range(n):
A.append([int(x) for x in str(input()).split()])
ans=[]
for i in range(10):
y=[]
for j in range(10):
x=[]
for k in range(n):
x.append(-1)
y.append(x)
ans.append(y)
#print(ans)
#print(A)
def f(ma,mb,cost,index):
if ans[m... |
s971888836 | p03806 | u408760403 | 1565659020 | Python | Python (3.4.3) | py | Runtime Error | 1463 | 60392 | 612 | N,Ma,Mb=map(int,input().split())
abc=[list(map(int,input().split())) for _ in range(N)]
INF=5000
dp=[[[INF]*(10*N+1) for _ in range(10*N+1)] for _ in range(N+1)]
dp[0][0][0]=0
for n in range(N):
a,b,c=abc[n][0],abc[n][1],abc[n][2]
for i in range(10*N+1):
for j in range(10*N+1):
if dp[n][i][j]==INF:
... |
s957503161 | p03806 | u285443936 | 1565192704 | Python | Python (3.4.3) | py | Runtime Error | 509 | 22004 | 754 | N,Ma,Mb = map(int,input().split())
table = []
sum_a,sum_b,sum_c = 0,0,0
for i in range(N):
a,b,c=map(int,input().split())
sum_a += a
sum_b += b
sum_c += c
table.append((a,b,c))
INF = sum_c+1
ans = INF
dp=[[[INF]*(sum_a+1) for i in range(sum_b+1)] for i in range(N+1)]
dp[0][0][0] = 0
for i in range(1,N+1)... |
s389100867 | p03806 | u191874006 | 1564820858 | Python | PyPy3 (2.4.0) | py | Runtime Error | 295 | 55772 | 1042 | #!/usr/bin/env python3
#ABC54 D
import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools im... |
s643634970 | p03806 | u865741247 | 1564625528 | Python | PyPy3 (2.4.0) | py | Runtime Error | 450 | 95836 | 651 |
import math
N,Ma,Mb = map(int,input().split(" "))
drags = [list(map(int,input().split(" "))) for _ in range(N)]
INF = 10 ** 9
lim = N * 10 + 1
dp = [[[ INF for i in range(lim)] for j in range(lim)] for _ in range(N+1)]
dp[0][0][0] = 0
for num in range( N ):
a,b,c = drags[num]
for i in range(a,401): #薬品厨のa の量... |
s548701847 | p03806 | u502389123 | 1564244154 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 953 | N, Ma, Mb = map(int, input().split())
a = [0] * N
b = [0] * N
c = [0] * N
for i in range(N):
a[i], b[i], c[i] = map(int, input().split())
INF = 10 ** 5
nums = 7
dp = [[[INF for _ in range(nums)] for _ in range(nums)] for _ in range(N+1)]
dp[0][0][0] = 0
for i in range(N):
for sum_a in range(nums):
f... |
s357285565 | p03806 | u838644735 | 1562042941 | Python | PyPy3 (2.4.0) | py | Runtime Error | 178 | 38384 | 1675 | N, Ma, Mb = map(int, input().split())
A = [0]*N
B = [0]*N
C = [0]*N
for i in range(N):
A[i], B[i], C[i] = map(int, input().split())
# print(N, Ma, Mb, A, B, C)
A = [Mb * a for a in A]
B = [Ma * b for b in B]
D = []
for i in range(N):
D.append((A[i] - B[i], C[i]))
# print(N, Ma, Mb, A, B, C, D)
Dp = []
Dn = ... |
s125189695 | p03806 | u838644735 | 1562042888 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2117 | 295920 | 1664 | N, Ma, Mb = map(int, input().split())
A = [0]*N
B = [0]*N
C = [0]*N
for i in range(N):
A[i], B[i], C[i] = map(int, input().split())
# print(N, Ma, Mb, A, B, C)
A = [Mb * a for a in A]
B = [Ma * b for b in B]
D = []
for i in range(N):
D.append((A[i] - B[i], C[i]))
# print(N, Ma, Mb, A, B, C, D)
Dp = []
Dn = ... |
s592697825 | p03806 | u838644735 | 1562040334 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2106 | 44380 | 1271 | N, Ma, Mb = map(int, input().split())
A = [0]*N
B = [0]*N
C = [0]*N
for i in range(N):
A[i], B[i], C[i] = map(int, input().split())
# print(N, Ma, Mb, A, B, C)
A = [Mb * a for a in A]
B = [Ma * b for b in B]
D = []
for i in range(N):
D.append((A[i] - B[i], C[i]))
# print(N, Ma, Mb, A, B, C, D)
Dp = []
Dn = ... |
s688098275 | p03806 | u777923818 | 1561434732 | Python | PyPy3 (2.4.0) | py | Runtime Error | 175 | 38512 | 415 | from itertools import combinations, permutations
def inpl(): return list(map(int, input().split()))
N, M = inpl()
G = [[0]*(N+1) for _ in range(N+1)]
for _ in range(M):
a, b = inpl()
G[a][b] = 1
G[b][a] = 1
ans = 0
for X in permutations(range(2, N+1)):
a = 1
for i in range(N-1):
b = X[i]
... |
s676392962 | p03806 | u969190727 | 1560296140 | Python | Python (3.4.3) | py | Runtime Error | 1946 | 59468 | 578 | n,ma,mb=map(int,input().split())
inf=10**4
A=[]
append=A.append
for i in range(n):
a,b,c=map(int,input().split())
append([a,b,c])
DP=[[[inf]*(10*n+1) for _ in range(10*n+1)] for _ in range(n+1)]
DP[0][0][0]=0
for i in range(n):
a,b,c=A[i][0],A[i][1],A[i][2]
for j in range(10*(i+1)+1):
for k in range(10*(i+1... |
s285157362 | p03806 | u285443936 | 1559785407 | Python | Python (3.4.3) | py | Runtime Error | 2107 | 3468 | 344 | N, Ma, Mb = map(int, input().split())
abc = [list(map(int, input().split())) for i in range(N)]
tmp = []
for i in range(2**N):
a, b = 0, 0
cost = []
for j in range(N):
if (i>>j) & 1:
cost.append(abc[j][2])
a += abc[j][0]
b += abc[j][1]
if a/Ma == b/Mb and sum(cost) > 0:
tmp.append(su... |
s855371918 | p03806 | u785989355 | 1559466261 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 635 | N,M=list(map(int,input().split()))
e_list = []
for i in range(M):
a,b,c = list(map(int,input().split()))
e_list.append([a-1,b-1,-c])
vi=0
min_dis_list = [10**27 for i in range(N)]
min_dis_list[vi] = 0
prev_list = [-1 for i in range(N)]
for i in range(N-1):
for e in e_list:
u,v,d = e
if mi... |
s922906438 | p03806 | u785989355 | 1559462913 | Python | Python (3.4.3) | py | Runtime Error | 1925 | 60016 | 663 |
N,A,B = list(map(int,input().split()))
item=[]
for i in range(N):
a,b,c = list(map(int,input().split()))
item.append([a,b,c])
D = [[[10**27 for i in range(401)] for j in range(401)] for k in range(N+1)]
D[0][0][0] = 0
for i in range(N):
for j in range(401):
for k in range(401):
if D[i... |
s929101467 | p03806 | u785989355 | 1559462826 | Python | Python (3.4.3) | py | Runtime Error | 361 | 56436 | 657 |
N,A,B = list(map(int,input().split()))
item=[]
for i in range(N):
a,b,c = list(map(int,input().split()))
item.append([a,b,c])
D = [[[10**27 for i in range(401)] for j in range(401)] for k in range(N+1)]
D[0][0] = 0
for i in range(N):
for j in range(401):
for k in range(401):
if D[j][k... |
s484633278 | p03806 | u785989355 | 1559462110 | Python | Python (3.4.3) | py | Runtime Error | 45 | 4340 | 563 | N,A,B = list(map(int,input().split()))
item=[]
for i in range(N):
a,b,c = list(map(int,input().split()))
item.append([a,b,c])
D = [[10**27 for i in range(401)] for j in range(401)]
D[0][0] = 0
for i in range(N):
for j in range(401):
for k in range(401):
if D[j][k]<10**27:
... |
s649683295 | p03806 | u562935282 | 1558167997 | Python | PyPy3 (2.4.0) | py | Runtime Error | 352 | 96476 | 824 | N, Ma, Mb = map(int, input().split())
e = [tuple(map(int, input().split())) for _ in range(N)]
N_max = 40
a_max = 10
b_max = 10
c_max = 100
inf = N_max * c_max + 1
dp = [[[inf for _ in range(N_max * b_max + 1)] for _ in range(N_max * a_max + 1)] for _ in range(N_max + 1)]
dp[0][0][0] = 0
# print(dp[N])
for i, (aa, ... |
s755052158 | p03806 | u798129018 | 1558140388 | Python | PyPy3 (2.4.0) | py | Runtime Error | 205 | 41072 | 586 | inf = 10**18
N,Ma,Mb = map(int,input().split())
abc = [list(map(int,input().split())) for _ in range(N)]
inf = 10**9
dp = [[inf for i in range(N*10)] for i in range(N*10)]
dp[0][0] = 0
max_a = 0
max_b = 0
for i in range(N):
max_a += abc[i][0]
max_b += abc[i][1]
for ai in range(abc[i][0],max_a+1)[::-1]:
... |
s081804044 | p03806 | u798129018 | 1558140348 | Python | PyPy3 (2.4.0) | py | Runtime Error | 201 | 40944 | 572 | N,Ma,Mb = map(int,input().split())
abc = [list(map(int,input().split())) for _ in range(N)]
inf = 10**9
dp = [[inf for i in range(N*10)] for i in range(N*10)]
dp[0][0] = 0
max_a = 0
max_b = 0
for i in range(N):
max_a += abc[i][0]
max_b += abc[i][1]
for ai in range(abc[i][0],max_a+1)[::-1]:
for bi in... |
s687826951 | p03806 | u533885955 | 1555194341 | Python | Python (3.4.3) | py | Runtime Error | 1863 | 59120 | 838 | #D問題
NM=40
ABM=10
MM=400
N,M1,M2=map(int,input().split())
A=[]
B=[]
C=[]
for i in range(N):
a,b,c=map(int,input().split())
A.append(a)
B.append(b)
C.append(c)
cmax=max(C)
CM=N*max(C)+1
dp=[[[CM for broop in range(401)] for aroop in range(401)] for nroop in range(NM)]
dp[0][0][0]=0
for i in range(N-1):
... |
s810403795 | p03806 | u533885955 | 1555193588 | Python | Python (3.4.3) | py | Runtime Error | 1746 | 58348 | 836 | #D問題
NM=40
ABM=10
MM=400
N,M1,M2=map(int,input().split())
A=[]
B=[]
C=[]
for i in range(N):
a,b,c=map(int,input().split())
A.append(a)
B.append(b)
C.append(c)
cmax=max(C)
CM=N*cmax
dp=[[[CM for broop in range(401)] for aroop in range(401)] for nroop in range(NM)]
dp[0][0][0]=0
for i in range(N):
fo... |
s082073159 | p03806 | u533885955 | 1555193498 | Python | Python (3.4.3) | py | Runtime Error | 1728 | 58224 | 787 | #D問題
NM=40
ABM=10
MM=400
N,M1,M2=map(int,input().split())
A=[]
B=[]
C=[]
for i in range(N):
a,b,c=map(int,input().split())
A.append(a)
B.append(b)
C.append(c)
cmax=max(C)
CM=N*cmax
dp=[[[CM for broop in range(401)] for aroop in range(401)] for nroop in range(NM)]
dp[0][0][0]=0
for i in range(N):
fo... |
s110612308 | p03806 | u319818856 | 1554564584 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 4508 | 908 | def mixing_experiment(N: int, Ma: int, Mb: int, drags: list)->int:
INF = float('inf')
max_A = N * max(a for a, _, _ in drags)
max_B = N * max(b for _, b, _ in drags)
dp = [[INF] * (max_A+1) for _ in range(max_B+1)]
dp[0][0] = 0
for (a, b, c) in drags:
for ca in range(max_A-a, -1, -1):
... |
s334637156 | p03806 | u319818856 | 1554525983 | Python | Python (3.4.3) | py | Runtime Error | 2107 | 57844 | 1103 | def mixing_experiment(N: int, Ma: int, Mb: int, drags: list)->int:
INF = float('inf')
max_A = N * max(a for a, _, _ in drags)
max_B = N * max(b for _, b, _ in drags)
dp = [
[[INF] * (max_A+1) for _ in range(max_B+1)]
for _ in range(N+1)
]
dp[0][0][0] = 0
for n, (a, b, c) in ... |
s256355988 | p03806 | u319818856 | 1554512843 | Python | Python (3.4.3) | py | Runtime Error | 2107 | 57848 | 1197 | def mixing_experiment(N: int, Ma: int, Mb: int, drags: list) -> int:
INF = float('inf')
max_A = max(a for a, _, _ in drags) * N
max_B = max(b for _, b, _ in drags) * N
dp = [
[[INF]*(max_A + 1) for _ in range(max_B + 1)]
for _ in range(N + 1)
]
dp[0][0][0] = 0
for n in range... |
s831185253 | p03806 | u123756661 | 1554422623 | Python | Python (3.4.3) | py | Runtime Error | 46 | 3188 | 472 | mod=1777777777
n,ma,mb=map(int,input().split())
d=[[mod for j in range(100)] for i in range(100)]
for i in range(n):
a,b,c=map(int,input().split())
x=a
y=b
for j in range(100-a,0,-1):
for k in range(100-b,0,-1):
if d[j][k]!=mod:
d[j+a][k+b]=min(d[j+a][k+b],d[j][k]+c)
... |
s472129424 | p03806 | u123756661 | 1554422455 | Python | Python (3.4.3) | py | Runtime Error | 66 | 3188 | 474 | mod=1777777777
n,ma,mb=map(int,input().split())
d=[[mod for j in range(100)] for i in range(100)]
for i in range(n):
a,b,c=map(int,input().split())
x=a
y=b
for j in range(100-a,0,-1):
for k in range(100-b-1,0,-1):
if d[j][k]!=mod:
d[j+a][k+b]=min(d[j+a][k+b],d[j][k]+c... |
s377596547 | p03806 | u123756661 | 1554356544 | Python | Python (3.4.3) | py | Runtime Error | 225 | 3316 | 442 | mod=1777777777
n,ma,mb=map(int,input().split())
d=[[mod for j in range(100)] for i in range(100)]
for i in range(n):
a,b,c=map(int,input().split())
x=a
y=b
d[x][y]=min(d[x][y],c)
for j in range(100-a):
for k in range(100-b):
if d[j][k]!=mod:
d[j+a][k+b]=min(d[j+a]... |
s697388755 | p03806 | u669696235 | 1552964373 | Python | Python (3.4.3) | py | Runtime Error | 26 | 3444 | 712 | import math
N,Ma,Mb=map(int,input().split())
cost=list()
for i in range(N):
a,b,c=map(int,input().split())
cost.append([a,b,c])
dp=[[float("inf") for _ in range(11)]for _ in range(11)]
dp[0][0]=0
from collections import deque
for i in range(N):
c=cost[i]
for j in range(0,11):
for z in range... |
s745506390 | p03806 | u585482323 | 1551735149 | Python | Python (3.4.3) | py | Runtime Error | 2127 | 361860 | 2205 | #!usr/bin/env python3
from collections import defaultdict
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): ... |
s634438138 | p03806 | u695811449 | 1551689585 | Python | Python (3.4.3) | py | Runtime Error | 1922 | 4872 | 512 | N,MA,MB=map(int,input().split())
S=[list(map(int,input().split())) for i in range(N)]
DPLIST=[[10**6 for i in range(401)] for j in range(401)]
DPLIST[0][0]=0
for a,b,c in S:
for i in range(400,a-1,-1):
for j in range(400,b-1,-1):
if DPLIST[i][j]>DPLIST[i-a][j-b]+c:
DPLIST[i][j]... |
s273063090 | p03806 | u690536347 | 1548990163 | Python | PyPy3 (2.4.0) | py | Runtime Error | 819 | 133596 | 550 | n,Ma,Mb=map(int,input().split())
inf=float("inf")
dp=[[[inf]*401 for _ in range(401)] for _ in range(n+1)]
dp[0][0][0]=0
l=[tuple(map(int,input().split())) for _ in range(n)]
for i in range(1,n+1):
for j in range(401):
for k in range(401):
a,b,c=l[i-1]
dp[i][j][k]=min(dp[i][j][k],d... |
s238785644 | p03806 | u588341295 | 1548303094 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 776 | # -*- coding: utf-8 -*-
import sys
def input(): return sys.stdin.readline().strip()
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7
N, Ma, Mb = map(int, input().split())
l = [[0] * 3 for i in range(N)]
for i in range(N):
l[i][0], l[i][1], l[i][2] = map(int, input().split())
memo = [[[INF] * 1... |
s680013881 | p03806 | u375616706 | 1547953129 | Python | Python (3.4.3) | py | Runtime Error | 1670 | 58312 | 735 | N, Ma, Mb = (list)(map(int, input().split()))
l = []
inf = 10**6
dp = [[[inf]*402 for _ in range(402)] for _ in range(40)]
for _ in range(N):
l.append((list)(map(int, input().split())))
dp[0][0][0] = 0
for i in range(N):
for ca in range(401):
for cb in range(401):
if dp[i][ca][cb] != inf... |
s242669503 | p03806 | u375616706 | 1547953063 | Python | Python (3.4.3) | py | Runtime Error | 1536 | 59752 | 735 | N, Ma, Mb = (list)(map(int, input().split()))
l = []
inf = 10**6
dp = [[[inf]*402 for _ in range(402)] for _ in range(40)]
for _ in range(N):
l.append((list)(map(int, input().split())))
dp[0][0][0] = 0
for i in range(N):
for ca in range(401):
for cb in range(401):
if dp[i][ca][cb] != inf... |
s556414100 | p03806 | u375616706 | 1547952483 | Python | Python (3.4.3) | py | Runtime Error | 1443 | 58220 | 757 | N, Ma, Mb = (list)(map(int, input().split()))
N_max = 40
abmax = 10
l = []
inf = 10**6
dp = [[[inf]*401 for _ in range(401)] for _ in range(40)]
for _ in range(N):
l.append((list)(map(int, input().split())))
dp[0][0][0] = 0
for i in range(N):
for ca in range(401):
for cb in range(401):
i... |
s824751378 | p03806 | u375616706 | 1547952031 | Python | Python (3.4.3) | py | Runtime Error | 1453 | 59244 | 751 | N, Ma, Mb = (list)(map(int, input().split()))
N_max = 40
abmax = 10
l = []
inf = 10**6
dp = [[[inf]*401 for _ in range(401)] for _ in range(40)]
for _ in range(N):
l.append((list)(map(int, input().split())))
dp[0][0][0] = 0
for i in range(N):
for ca in range(401):
for cb in range(401):
i... |
s714292392 | p03806 | u427344224 | 1547700678 | Python | PyPy3 (2.4.0) | py | Runtime Error | 434 | 106716 | 885 | N, Ma, Mb = map(int, input().split())
items = []
for i in range(N):
a, b, c = map(int, input().split())
items.append((a, b, c))
a_sum = sum([item[0] for item in items])
b_sum = sum([item[1] for item in items])
inf = float("inf")
dp = [[[inf for _ in range(a_sum + 40)] for _ in range(b_sum + 40)] for i in range... |
s584063149 | p03806 | u427344224 | 1547700656 | Python | PyPy3 (2.4.0) | py | Runtime Error | 409 | 90460 | 885 | N, Ma, Mb = map(int, input().split())
items = []
for i in range(N):
a, b, c = map(int, input().split())
items.append((a, b, c))
a_sum = sum([item[0] for item in items])
b_sum = sum([item[1] for item in items])
inf = float("inf")
dp = [[[inf for _ in range(a_sum + 20)] for _ in range(b_sum + 20)] for i in range... |
s854323767 | p03806 | u427344224 | 1547699993 | Python | Python (3.4.3) | py | Runtime Error | 496 | 56308 | 761 | N, Ma, Mb = map(int, input().split())
items = []
for i in range(N):
a, b, c = map(int, input().split())
items.append((a, b, c))
inf = float("inf")
dp = [[[inf for _ in range(401)] for _ in range(401)] for i in range(N+1)]
dp[0][0][0] = 0
for i in range(N):
for a in range(401):
for b in range(401):... |
s927370938 | p03806 | u427344224 | 1547699686 | Python | Python (3.4.3) | py | Runtime Error | 2106 | 30452 | 881 | N, Ma, Mb = map(int, input().split())
items = []
for i in range(N):
a, b, c = map(int, input().split())
items.append((a, b, c))
a_sum = sum([item[0] for item in items])
b_sum = sum([item[1] for item in items])
inf = float("inf")
dp = [[[inf for _ in range(a_sum + 40)] for _ in range(b_sum + 40)] for i in range... |
s804091828 | p03806 | u427344224 | 1547699645 | Python | Python (3.4.3) | py | Runtime Error | 2105 | 27508 | 881 | N, Ma, Mb = map(int, input().split())
items = []
for i in range(N):
a, b, c = map(int, input().split())
items.append((a, b, c))
a_sum = sum([item[0] for item in items])
b_sum = sum([item[1] for item in items])
inf = float("inf")
dp = [[[inf for _ in range(a_sum + 20)] for _ in range(b_sum + 20)] for i in range... |
s867879482 | p03806 | u427344224 | 1547699442 | Python | Python (3.4.3) | py | Runtime Error | 552 | 23668 | 881 | N, Ma, Mb = map(int, input().split())
items = []
for i in range(N):
a, b, c = map(int, input().split())
items.append((a, b, c))
a_sum = sum([item[0] for item in items])
b_sum = sum([item[1] for item in items])
inf = float("inf")
dp = [[[inf for _ in range(a_sum + 11)] for _ in range(b_sum + 11)] for i in range... |
s340029879 | p03806 | u738835924 | 1545691223 | Python | Python (3.4.3) | py | Runtime Error | 2120 | 213364 | 526 | 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(N):
a,b,c = map(int, input().split())
for j in range(401):
for k in range(401):
if j-a < 0 or k-b < 0:
dp[i+1][j][k] = dp[i][j][k]
else... |
s592674073 | p03806 | u054106284 | 1543987256 | Python | Python (3.4.3) | py | Runtime Error | 2107 | 60920 | 736 | N, Ma, Mb= (int(i) for i in input().split())
L = []
for i in range(N):
a, b, c = (int(i) for i in input().split())
L.append((a-1, b-1, c))
dp= [[[float("inf")] * (10 * N + 11) for a in range(10 * N + 11) ] for i in range(N + 1)]
dp[0][0][0] = 0
for i in range(N + 1):
a, b, c = L[i]
for ca in range(10 ... |
s021693596 | p03806 | u054106284 | 1543986538 | Python | Python (3.4.3) | py | Runtime Error | 1694 | 213368 | 741 | N, Ma, Mb= (int(i) for i in input().split())
L = []
for i in range(N):
a, b, c = (int(i) for i in input().split())
L.append((a-1, b-1, c))
dp= [[[float("inf") for b in range(10 * N + 1)] for a in range(10 * N + 1) ] for i in range(N + 1)]
dp[0][0][0] = 0
for i in range(N):
a, b, c = L[i]
for ca in ran... |
s866166818 | p03806 | u426108351 | 1540405844 | Python | PyPy3 (2.4.0) | py | Runtime Error | 183 | 39408 | 644 | import itertools
import numpy
N, Ma, Mb = map(int, input().split())
r = Ma/Mb
costlist = []
data = [list(map(int, input().split())) for i in range(N)]
for i in range(1, max(N+1, 11)):
combination = numpy.array(list(itertools.combinations(data, i)))
for k in range(len(combination)):
a_tot = 0
b_t... |
s607719982 | p03806 | u785989355 | 1539968897 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2696 | 621 | N,ma,mb = map(int,raw_input().split())
a=[]
b=[]
c=[]
for i in range(N):
at,bt,ct=map(int,raw_input().split())
a.append(at)
b.append(bt)
c.append(ct)
dp = [[[10**10 for i in range(400+1)] for j in range(400+1)] for k in range(N+1)]
dp[0][0][0]=0
for i in range(N):
for j in range(401):
for k in range(401):
... |
s676295028 | p03806 | u942033906 | 1537823426 | Python | Python (3.4.3) | py | Runtime Error | 1739 | 3188 | 1327 | N,Ma,Mb = map(int,input().split())
first_half = []
last_half = []
for i in range(N):
a,b,c = map(int,input().split())
if i < N // 2:
first_half.append((a,b,c))
else:
last_half.append((a,b,c))
first_half_combination = {}
last_half_combination = {}
def make_all_combination(i,a,b,c,d_list,flag):
if i == len(d_lis... |
s024333021 | p03806 | u942033906 | 1537822848 | Python | Python (3.4.3) | py | Runtime Error | 80 | 3964 | 1399 | N,Ma,Mb = map(int,input().split())
first_half = []
last_half = []
for i in range(N):
a,b,c = map(int,input().split())
if i < N // 2:
first_half.append((a,b,c))
else:
last_half.append((a,b,c))
first_half_combination = {}
last_half_combination = {}
def make_all_combination(i,a,b,c,d_list,flag):
if i == len(d_lis... |
s951641046 | p03806 | u354638986 | 1530118255 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 1054 | #include <iostream>
#include <algorithm>
using namespace std;
const int max_n = 40, max_ab = 10, INF = 100001;
int a[max_n], b[max_n], c[max_n];
int dp[max_n + 1][max_n*max_ab + 1][max_n*max_ab + 1];
int main()
{
int n, ma, mb;
cin >> n >> ma >> mb;
for (int i = 0;i < n;i++) {
cin >> a[i] >> b[i] >> c[i];
}
... |
s947242557 | p03806 | u522398430 | 1530005378 | Python | Python (3.4.3) | py | Runtime Error | 2109 | 14180 | 663 | import numpy as np
from functools import reduce
N, Ma, Mb = map(int, input().split())
X = np.array([list(map(int, input().split())) for _ in range(N)])
z = []
def update_z(_y, index2):
tmp = reduce(lambda a,b:a+b, [x for k,x in enumerate(X) if k in index2])
if tmp[0]*Mb == tmp[1]*Ma:
z.append(min(_y, ... |
s558446901 | p03806 | u732963817 | 1529999345 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 578 | from itertools import combinations
N, Ma, Mb = list(map(int, input().split()))
abc = [list(map(int, input().split())) for _ in range(N)]
c_max = abc[np.array([_i[2] for _i in abc], dtype='int8').argmax()]
min_cost = -1
for _i in range(1, N+1):
all_pattern = list(combinations(range(N), _i))
for _j in all_pattern... |
s055008844 | p03806 | u732963817 | 1529999197 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 578 | N, Ma, Mb = list(map(int, input().split()))
abc = [list(map(int, input().split())) for _ in range(N)]
from itertools import combinations
c_max = abc[np.array([_i[2] for _i in abc], dtype='int8').argmax()]
min_cost = -1
for _i in range(1, N+1):
all_pattern = list(combinations(range(N), _i))
for _j in all_pattern... |
s824627757 | p03806 | u467736898 | 1529543202 | Python | PyPy3 (2.4.0) | py | Runtime Error | 171 | 38384 | 578 | N, Ma, Mb = map(int, input().split())
L = [[float("inf")]*410 for i in range(410)]
P = [[0, 0]]
L[0][0] = 0
for i in range(N):
a, b, c = map(int, input().split())
OldP = P.copy()
Lsub = [L[p[0]][p[1]] for p in OldP]
for xp, p in enumerate(OldP):
if L[p[0]+a][p[1]+b] == float("inf"):
... |
s892366979 | p03806 | u682985065 | 1527727696 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 692 | n, ma, mb = map(int, f.readline().split())
a, b, c = [], [], []
for _ in range(n):
at, bt, ct = map(int, f.readline().split())
a.append(at)
b.append(bt)
c.append(ct)
dp = [[float('inf') for _ in range(n*mb + 1)] for _ in range(n*ma + 1)]
dp[0][0] = 0
used = [[0, 0]]
for i in range(n):
add_used... |
s324863605 | p03806 | u777923818 | 1526678791 | Python | Python (3.4.3) | py | Runtime Error | 44 | 5748 | 584 | # -*- coding: utf-8 -*-
def inpl(): return map(int, input().split())
N, Ma, Mb = inpl()
INF = 4001
DP = [[INF]*(411) for _ in range(411)]
DP[0][0] = 0
for i in range(N):
DP2 = [[INF]*(411) for _ in range(411)]
a, b, c = inpl()
for i in range(10*(i+1) + 1):
for j in range(10*(i+1) + 1):
... |
s189208873 | p03806 | u653005308 | 1524707735 | Python | Python (3.4.3) | py | Runtime Error | 570 | 84852 | 849 | n,ma,mb=map(int,input().split())
lista=[]
listb=[]
listc=[]
for i in range(n):
a,b,c=map(int,input().split())
lista.append(a)
listb.append(b)
listc.append(c)
x=sum(lista)
y=sum(listb)
z=0
w=0
dp=[[[float('inf') for i in range(n+1)]for i\
in range(y+1)]for i in range(x+1)]
for i in range(n+1):
dp[0]... |
s980395593 | p03806 | u653005308 | 1524707668 | Python | Python (3.4.3) | py | Runtime Error | 584 | 84852 | 896 | n,ma,mb=map(int,input().split())
lista=[]
listb=[]
listc=[]
for i in range(n):
a,b,c=map(int,input().split())
lista.append(a)
listb.append(b)
listc.append(c)
x=sum(lista)
y=sum(listb)
z=0
w=0
dp=[[[float('inf') for i in range(n+1)]for i\
in range(y+1)]for i in range(x+1)]
for i in range(n+1):
dp[0]... |
s469564552 | p03806 | u653005308 | 1524700397 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 697 | n,ma,mb=map(int,input().split())
lista=[]
listb=[]
listc=[]
for i in range(n):
a,b,c=map(int,input().split())
lista.append(a)
listb.append(b)
listc.append(c)
dp=[[[float('inf') for i in range(n+1)]for i\
in range(sum(listb)+1)]for i in range(sum(lista)+1)]
dp[0][0][0]=0
for i in range(1,n+1):
for a... |
s775038101 | p03806 | u231685196 | 1524087440 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 720 | def gcd(a,b):
if a<b:
a,b = b,a
if b == 0:
return a
c = a%b
return gcd(b,c)
dp = []
dp.append({(0,0):0})
N,A,B = map(int,input().split())
for i in range(N):
a,b,c = map(int,input().split())
temp = dp[-1].copy()
for key in dp[-1].keys():
left = key[0] + a
rig... |
s013012475 | p03806 | u231685196 | 1524087177 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 629 | import math
dp = []
dp.append({(0,0):0})
N,A,B = map(int,input().split())
for i in range(N):
a,b,c = map(int,input().split())
temp = dp[-1].copy()
for key in dp[-1].keys():
left = key[0] + a
right = key[1] + b
g = math.gcd(left, right)
if g != 1:
left = int(left... |
s279440317 | p03806 | u391475811 | 1521690150 | Python | Python (3.4.3) | py | Runtime Error | 1613 | 82024 | 927 | N,Ma,Mb=map(int,input().split())
Med=[]
cnt_a=0
cnt_b=0
for i in range(N):
a=[int(x) for x in input().split()]
Med.append(a)
cnt_a+=a[0]
cnt_b+=a[1]
#[i]まででMa=[j],Mb=[k]を作る場合の最小のコストdp
#dp[i+1][j+Ma][k+Mb]=min(dp[i][j+Ma][k+Mb],dp[i][j][k]+Cost)
#リストをinfで初期化。inf=作れない配合なので、continue。初期値はdp[0][0][0]=0
dp=[[[floa... |
s669379462 | p03806 | u785205215 | 1507671371 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 1053 | from sys import stdin, setrecursionlimit
setrecursionlimit(10000)
def readLine_int_list():return list(map(int, stdin.readline().split()))
def readAll_int(): return list(list(map(int,i.split())) for i in stdin.read().split("\n"))
def gcd(a, b):
while b:
a, b = b, a % b
return a
def ratio(a,b):
... |
s828681264 | p03806 | u785205215 | 1507671307 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3064 | 1052 | from sys import stdin, setrecursionlimit
setrecursionlimit(5000)
def readLine_int_list():return list(map(int, stdin.readline().split()))
def readAll_int(): return list(list(map(int,i.split())) for i in stdin.read().split("\n"))
def gcd(a, b):
while b:
a, b = b, a % b
return a
def ratio(a,b):
r... |
s066084990 | p03806 | u785205215 | 1507671243 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 1067 | from sys import stdin, setrecursionlimit
setrecursionlimit
setrecursionlimit(5000)
def readLine_int_list():return list(map(int, stdin.readline().split()))
def readAll_int(): return list(list(map(int,i.split())) for i in stdin.read().split("\n"))
def gcd(a, b):
while b:
a, b = b, a % b
return a
def ... |
s287137235 | p03806 | u785205215 | 1507671204 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 1056 | from sys import stdin, stdout
setrecursionlimit
setrecursionlimit(5000)
def readLine_int_list():return list(map(int, stdin.readline().split()))
def readAll_int(): return list(list(map(int,i.split())) for i in stdin.read().split("\n"))
def gcd(a, b):
while b:
a, b = b, a % b
return a
def ratio(a,b):... |
s668426759 | p03806 | u785205215 | 1507671148 | Python | PyPy3 (2.4.0) | py | Runtime Error | 173 | 38640 | 1014 | from sys import stdin, stdout
def readLine_int_list():return list(map(int, stdin.readline().split()))
def readAll_int(): return list(list(map(int,i.split())) for i in stdin.read().split("\n"))
def gcd(a, b):
while b:
a, b = b, a % b
return a
def ratio(a,b):
return (a//gcd(a,b), b//gcd(a,b))
d... |
s841556722 | p03806 | u785205215 | 1507670984 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 1003 | from sys import stdin, stdout
def readLine_int_list():return list(map(int, stdin.readline().split()))
def readAll_int(): return list(list(map(int,i.split())) for i in stdin.read().split("\n"))
def gcd(a, b):
while b:
a, b = b, a % b
return a
def ratio(a,b):
return (a//gcd(a,b), b//gcd(a,b))
def add_rati... |
s367362097 | p03806 | u785205215 | 1507649325 | Python | Python (3.4.3) | py | Runtime Error | 27 | 3700 | 1037 | from sys import stdin, stdout
from pprint import pprint
def readLine_int_list():return list(map(int, stdin.readline().split()))
def readAll_int(): return list(list(map(int,i.split())) for i in stdin.read().split("\n"))
def gcd(a, b):
while b:
a, b = b, a % b
return a
def ratio(a,b):
return (a//gcd(a,b), b//... |
s378479669 | p03806 | u785205215 | 1507649216 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 997 | from sys import stdin, stdout
def readLine_int_list():return list(map(int, stdin.readline().split()))
def readAll_int(): return list(list(map(int,i.split())) for i in stdin.read().split("\n"))
def gcd(a, b):
while b:
a, b = b, a % b
return a
def ratio(a,b):
return (a//gcd(a,b), b//gcd(a,b))
def add_ratio(a,b... |
s001166997 | p03806 | u785205215 | 1507649144 | Python | Python (3.4.3) | py | Runtime Error | 27 | 3700 | 1025 | from sys import stdin, stdout
from pprint import pprint
def readLine_int_list():return list(map(int, stdin.readline().split()))
def readAll_int(): return list(list(map(int,i.split())) for i in stdin.read().split("\n"))
def gcd(a, b):
while b:
a, b = b, a % b
return a
def ratio(a,b):
return (a//gcd(a,b), b//... |
s291411882 | p03806 | u010110540 | 1506997508 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 1020 | def solve():
INF = float('inf')
N, Ma, Mb = map(int, input().split())
l = []
for _ in range(N):
a,b,c = map(int, input().split())
l.append((a,b,c))
#dp table: dp[i][ca][cb]
dp = [[[INF] * 401 for _ in range(401)] for _ in range(N+1)]
dp[0][0][0] = 0
... |
s924860777 | p03806 | u683479402 | 1494464927 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 848 | # ABC54 D
n,ma,mb = map(int, input().split())
a = []
b = []
c = []
for i in range(N):
ai,bi,ci = map(int, input().split())
a.append(ai)
b.append(bi)
c.append(ci)
max_sum = n * 10
max_cost = 100000000
dp = [[[max_cost for k in range(max_sum+1)] for j in range(max_sum+1)] for i in range(n+1)]
dp[0][... |
s944875373 | p03806 | u683479402 | 1494464519 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3192 | 844 | # ABC54 D
n,ma,mb = map(int, input().split())
a = []
b = []
c = []
for i in range(N):
ai,bi,ci = map(int, input().split())
a.append(ai)
b.append(bi)
c.append(ci)
max_sum = n * 10
max_cost = 100000000
dp = [[[max_cost for k in range(n+1)] for j in range(max_sum+1)] for i in range(max_sum+1)]
dp[0][... |
s793797912 | p03806 | u683479402 | 1494464518 | Python | Python (3.4.3) | py | Runtime Error | 25 | 3444 | 844 | # ABC54 D
n,ma,mb = map(int, input().split())
a = []
b = []
c = []
for i in range(N):
ai,bi,ci = map(int, input().split())
a.append(ai)
b.append(bi)
c.append(ci)
max_sum = n * 10
max_cost = 100000000
dp = [[[max_cost for k in range(n+1)] for j in range(max_sum+1)] for i in range(max_sum+1)]
dp[0][... |
s620441783 | p03806 | u712187387 | 1487022583 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 512 | import itertools
import numpy as np
N,Ma,Mb=map(int,input().split())
yaku=[]
for _ in range(N):
yaku.append(list(map(int,input().split())))
candi_money=[]
for n in range(N):
candis=list(itertools.combinations(np.arange(N),n))
for candi in candis:
a,b,c=0,0,0
for num in candi:
... |
s491728568 | p03806 | u210440747 | 1486894842 | Python | Python (3.4.3) | py | Runtime Error | 368 | 27380 | 1008 | import numpy as np
import copy
if __name__=="__main__":
inputs_number = lambda : [int(x) for x in input().split()]
N, Ma, Mb = inputs_number()
drugs = [inputs_number() for i in range(N)]
inf = 100*N + 1
dp = np.ones((2,N*10+1,N*10+1)).astype(np.int32) * inf
dp = dp.tolist()
dp[0][0][0] = 0... |
s260993299 | p03806 | u210440747 | 1486894038 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3064 | 908 | import numpy as np
if __name__=="__main__":
inputs_number = lambda : [int(x) for x in input().split()]
N, Ma, Mb = inputs_number()
drugs = [inputs_number() for i in range(N)]
inf = 100*N + 1
dp = np.ones((N+1,N*10+1,N*10+1)).astype(np.int32) * inf
dp = dp.tolist()
dp[0][0][0] = 0.0
fo... |
s085790355 | p03806 | u210440747 | 1486893863 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 891 | import numpy as np
if __name__=="__main__":
inputs_number = lambda : [int(x) for x in input().split()]
N, Ma, Mb = inputs_number()
drugs = [inputs_number() for i in range(N)]
inf = 100*N + 1
dp = np.ones((N+1,N*10+1,N*10+1)).astype(np.int32) * inf
dp = dp.tolist()
dp[0][0][0] = 0.0
fo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.