上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 52 下一页
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1074状压dp不是很懂,看着别人的代码写的,很长时间才看懂。 dp[i]记录(1 2 #include 3 #include 4 #define maxn 16 5 using namespace std; 6... 阅读全文
posted @ 2014-10-14 21:32 null1019 阅读(137) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4544优先队列+贪心。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define ll long long 7 #define ma... 阅读全文
posted @ 2014-10-14 19:08 null1019 阅读(171) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4541打表找规律 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int t; 7 int n,m; 8 int a[25][25]=... 阅读全文
posted @ 2014-10-14 18:12 null1019 阅读(159) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4540dp公式:dp[i][j]=min(dp[i][j],dp[i-1][c]+abs(a[i][j]-a[i-1][c]));dp[i][j] 表示:第i时刻第j个地鼠的最小能量。 1 #include 2 ... 阅读全文
posted @ 2014-10-14 10:53 null1019 阅读(259) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4535 错排公式:a[i]=(i-1)*(a[i-2]+a[i-1]); 1 #include 2 #include 3 #include 4 #define ll long long 5 #define m... 阅读全文
posted @ 2014-10-14 10:20 null1019 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 题意:能否在一个整数序列的每相邻的两项之间添加一个加减号,使得最终结果能被一个给定整数K 2 #include 3 #include 4 #define maxn 20000 5 using namespace std; 6 7 int t; 8 int n,k; 9 int a[maxn];... 阅读全文
posted @ 2014-10-13 19:50 null1019 阅读(151) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=975最小生成树。 1 #include 2 #include 3 #include 4 #includ... 阅读全文
posted @ 2014-10-13 18:57 null1019 阅读(119) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=973 1 #include 2 #include 3 #include 4 #define ll lo... 阅读全文
posted @ 2014-10-13 00:37 null1019 阅读(242) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=970通过对每一个字符串,每一个位置进行枚举三个操作,然后二分查找操作后的字符串是否存在,dp记录。 1 #... 阅读全文
posted @ 2014-10-12 22:14 null1019 阅读(171) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=967对价钱与天数比例排序,贪心即可。 1 #include 2 #include 3 #include ... 阅读全文
posted @ 2014-10-12 18:38 null1019 阅读(123) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 52 下一页