POJ 2229 Sumsets——完全背包
来源:互联网 发布:mac 命令行启动mysql 编辑:程序博客网 时间:2024/06/03 04:14
#include <cstdio>#include <cstring>#include <iostream>#include <algorithm>using namespace std;const int maxn = 1e6 + 5;const int mod = 1e9;int a[32], dp[maxn];int main() { a[0] = 1; for (int i = 1; i <= 20; i++) a[i] = a[i - 1] * 2; dp[0] = 1; for (int i = 0; i <= 20; i++) { for (int j = a[i]; j < maxn; j++) { dp[j] = (dp[j] + dp[j - a[i]]) % mod; } } int n; while (~scanf("%d", &n)) printf("%d\n", dp[n]); return 0;}
阅读全文
1 0
- POJ 2229 Sumsets——完全背包
- poj 2229 Sumsets 完全背包
- POJ 2229 Sumsets 完全背包问题
- poj 2229 Sumsets 【完全背包 or 递推】
- POJ2229-Sumsets-完全背包
- 刷题——Sumsets POJ
- 完全背包——POJ 2063
- 完全背包——POJ 2063
- POJ 2229 Sumsets
- poj 2229 Sumsets
- [POJ] 2229 Sumsets
- sumsets poj 2229
- POJ-2229-Sumsets
- poj 2229 Sumsets
- poj 2229 Sumsets DP
- POJ 2229 Sumsets DP
- poj 2229 Sumsets
- poj-2229-Sumsets
- 干货丨一文读懂深度学习(附学习资源,据说点赞2W+)
- 深度丨AI挑战人类情感!机器人写诗出书背后透露了什么?
- CSS 黑魔法小技巧,让你少写不必要的JS,代码更优雅
- Bootstrap 之Table样式
- @Interceptor、@Interceptors源码翻译
- POJ 2229 Sumsets——完全背包
- osgEarth shapefile矢量生成三维模型案例 2.boston.earth
- 资料整理
- Android手势滑动(左滑和右滑)
- OpenStack环境搭建(3) --网络节点
- v$session
- 使用NIO进行快速的文件拷贝
- 单点登录原理与简单实现
- opencv编程指南