思路:

f[i]表示还剩i空间的方案数

套个高精 (网上有人把它拆成了两个long long)

其实这道题的高精并不难写…..

//By SiriusRen
#include <cstdio>
using namespace std;
int n,k,f[1111][53],flag;
int main(){
scanf("%d%d",&n,&k);
f[n][0]=1;
for(int i=1;i<=k;i++)
for(int j=n-i;j>=0;j--)
for(int l=0;l<=50;l++){
int temp=f[j][l]+f[j+i][l];
f[j][l]=temp%10;
f[j][l+1]+=temp/10;
}
for(int i=50;i>=0;i--){
if(f[0][i])flag=1;
if(flag)printf("%d",f[0][i]);
}
}

最新文章

  1. Hadoop家族的各个成员
  2. 可以改变this指向的方法
  3. js Date 函数方法 和 移动端数字键盘调用
  4. Expect 初学
  5. 淘宝ip库接口调用
  6. spring classpath &amp; classpath*
  7. shell之here文档
  8. Kruskal
  9. js获取客户端IP及地理位置
  10. 在 IIS MIME 类型中添加 md 扩展名
  11. unity3d shader之Roberts,Sobel,Canny 三种边缘检测方法
  12. 评论PK投票功能的手机版
  13. [TroubleShooting]&amp;#39;trn\bak&amp;#39; is incorrectly formed. SQL Server cannot process this media family.
  14. 设计模式--命令模式(Command)
  15. 98、vue.js简单入门
  16. fiddler安装 与 https
  17. Python——高阶函数——map filter zip
  18. MySQL 索引的增删查
  19. 【原创】自己动手写一个能操作redis的客户端
  20. Swift搭建本地http服务器,实现外部视频即时播放

热门文章

  1. react-native 编译 undefined is not an object (evaluating &#39;_react2.PropTypes.func&#39;)
  2. Mysql学习总结(23)——MySQL统计函数和分组查询
  3. 2015 Multi-University Training Contest 1 hdu 5290 Bombing plan
  4. How to enable wire logging for a java HttpURLConnection traffic?
  5. 调用Windows属性窗口
  6. storm trident function函数
  7. 错误处理:java.lang.NoSuchMethodException: org.apache.catalina.deploy.WebXml addFilter
  8. 【C++探索之旅】第二部分第一课:面向对象初探,string的惊天内幕
  9. json的认识及对json数据的相互转化
  10. POJ 3277 线段树+扫描线