HDU 2082 母函数法
2024-09-04 10:05:43
#include <cstdio>
#include <cstring> using namespace std; int cnt[] , dp[][]; int main()
{
// freopen("a.in" , "r" , stdin);
int T;
scanf("%d" , &T);
while(T--){
for(int i= ; i<= ; i++)
scanf("%d" , cnt+i); memset(dp , , sizeof(dp));
dp[][] = ;
for(int i= ; i<= ; i++){
for(int j= ; j<=cnt[i] ; j++){
if(i*j > ) break;
for(int k=-i*j ; k>= ; k--){
dp[i][i*j+k] += dp[i-][k];
}
}
}
int ans = ;
for(int i = ; i<= ; i++)
ans += dp[][i];
printf("%d\n" , ans);
}
return ;
}
最新文章
- dataTables获取当前行json格式数据
- web.xml添加编码过滤器
- Java Spring的IoC和AOP的知识点速记
- OC中的protocol
- 【转】ACM/ICPC生涯总结暨退役宣言—alpc55
- where,having与 group by连用的区别
- PHP乱码问题,UTF-8(乱码)
- escape()、encodeURI()、encodeURIComponent() difference
- JDBC Thin Driver 的formats三种格式
- 017. ADO.NET Connection和command及DataReader
- CSS之全屏背景图
- MySQL.. ERROR! The server quit without updating PID file问题解决
- Android(java)学习笔记170:Activity的生命周期
- (转)Mono for Android 优势与劣势
- PPT去掉图片白色背景
- poj3311(状压dp)
- 关于tab选项卡,选项的css问题。
- VMware Workstation 12 Pro 之安装林耐斯-Solus-系统
- linux服务器情况
- FileReader实现图片预览,并上传(js代码)