HDUOj Ignatius and the Princess III 题目1002
来源:互联网 发布:photoshop for mac下载 编辑:程序博客网 时间:2024/04/29 19:13
母函数 组合数学
#include<stdio.h>
int c1[125];
int c2[125];
int main()
{
int n,i,j,k;
while(scanf("%d",&n)!=EOF)
{
for(i=0;i<=n;i++)
{
c1[i]=1;
c2[i]=0;
}
for(i=2;i<=n;i++)
{
for(j=0;j<=n;j++)
for(k=0;k+j<=n;k=k+i)
c2[k+j]=c2[k+j]+c1[j];
for(j=0;j<=n;j++)
{
c1[j]=c2[j];
c2[j]=0;
}
}
printf("%d\n",c1[n]);
}
return 0;
}
0 0
- HDUOj Ignatius and the Princess III 题目1002
- Ignatius and the Princess III
- Ignatius and the Princess III
- Ignatius and the Princess III
- Ignatius and the Princess III
- Ignatius and the Princess III
- Ignatius and the Princess III
- Ignatius and the Princess III
- Ignatius and the Princess III
- Ignatius and the Princess III
- Ignatius and the Princess III
- Ignatius and the Princess III
- Ignatius and the Princess III
- Ignatius and the Princess III
- Ignatius and the Princess III
- HDUOJ - 1027 Ignatius and the Princess II
- HDUOJ 1027 Ignatius and the Princess II
- hdu1028 Ignatius and the Princess III
- PHP设计模式之工厂方法模式(Factory Method)
- 计蒜课-奇怪的国家
- Ubuntu15.04 QT5编译出现cannot find -lGL 和 collect2:error:ld returned 1 exit status 错误
- 关于move_uploaded_file()出错的问题
- UE4学习笔记1st
- HDUOj Ignatius and the Princess III 题目1002
- Android Gradle Plugin指南(一)——简介 - 琴弦第七的专栏 - 博客频道 - CSDN.NET
- UVA 10420 List of Conquests
- [Leetcode 141] Linked List Cycle
- vector 三
- Watch The Movie(严格限制数量的二维费用背包)
- GTK入门学习:布局练习之计算器
- 读书笔记4 用户体验要素
- 三个同步与互斥问题之哲学家就餐