摘要: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=666本来是找背包问题做的. 搜到这题, 结果完全没有背包的思路, 看了别人的题解. 也不觉得是背包.....⊙﹏⊙b汗View Code 1 #include <iostream> 2 #define maxn 305 3 using namespace std; 4 int ans[maxn], v[20]; 5 int main() 6 { 7 int i, j, m, count; 8 for(i = 1; i <= 17; i++) 9 v[... 阅读全文
posted @ 2012-08-31 16:34 YORU 阅读(141) 评论(0) 推荐(0)
摘要: http://acm.nyist.net/JudgeOnline/problem.php?pid=4560/1背包问题View Code 1 #include <iostream> 2 #define maxn 100005 3 using namespace std; 4 int ans[maxn], v[maxn]; 5 int main() 6 { 7 long t, n, i, j, sum, m; 8 cin >> t; 9 while(t--)10 {11 cin >> n;12 sum = 0;13 ... 阅读全文
posted @ 2012-08-31 12:01 YORU 阅读(157) 评论(0) 推荐(0)
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1059很弱....时间是750ms....View Code 1 #include <iostream> 2 #define n 7 3 #define maxn 125005 4 using namespace std; 5 int main() 6 { 7 long t=0, i, j, l, sum, ans[maxn], v[n], num[n], m; 8 while(1) 9 {10 t++;11 sum = 0;12 fo... 阅读全文
posted @ 2012-08-31 10:20 YORU 阅读(201) 评论(0) 推荐(0)