标签:style blog http color for sp div log amp
maxm=10000 v=[150,200,350] t=int(raw_input()) for ii in range(0,t): m=int(raw_input()) f=[] for j in range(0,m+1): f.append(m) for i in range(0,3): for j in range(1,m+1): if j>=v[i]: f[j]=min(f[j],f[j-v[i]]-v[i]) print f[m]
完全背包
标签:style blog http color for sp div log amp
原文地址:http://www.cnblogs.com/nbalive2001/p/4042349.html