1028 Ignatius and the Princess III
来源:互联网 发布:mysql的having max函数 编辑:程序博客网 时间:2024/05/29 04:40
#include<iostream>
using namespace std;
const int lmax=120;
int c1[lmax+1],c2[lmax+1];
int main()
{
int n,i,j,k;
while(cin>>n)
{
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+=i)
{
c2[j+k]+=c1[j];
}
for(j=0;j<=n;j++)
{
c1[j]=c2[j];
c2[j]=0;
}
}
cout<<c1[n]<<endl;
}
return 0;
}
using namespace std;
const int lmax=120;
int c1[lmax+1],c2[lmax+1];
int main()
{
int n,i,j,k;
while(cin>>n)
{
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+=i)
{
c2[j+k]+=c1[j];
}
for(j=0;j<=n;j++)
{
c1[j]=c2[j];
c2[j]=0;
}
}
cout<<c1[n]<<endl;
}
return 0;
}
- 1028 Ignatius and the Princess III
- hdu 1028 Ignatius and the Princess III
- HDOJ 1028:Ignatius and the Princess III
- HDU 1028 Ignatius and the Princess III
- hdu 1028 Ignatius and the Princess III
- HDU 1028 Ignatius and the Princess III
- hdoj 1028 Ignatius and the Princess III
- HDU 1028 Ignatius and the Princess III
- hdu 1028 Ignatius and the Princess III
- HDU-1028-Ignatius and the Princess III
- HDU 1028 Ignatius and the Princess III
- HDU 1028 Ignatius and the Princess III
- hdu 1028 Ignatius and the Princess III
- hdu 1028 Ignatius and the Princess III
- hdu 1028 Ignatius and the Princess III
- hdu 1028 Ignatius and the Princess III
- hdu 1028 Ignatius and the Princess III
- hdu 1028 Ignatius and the Princess III
- 2008 October 9th Thursday (十月 九日 木曜日)
- 1021 Fibonacci Again
- 2008 October 10th Friday (十月 十日 金曜日)
- 1022 Train Problem I
- 2008 October 13th Monday (十月 十三日 月曜日)
- 1028 Ignatius and the Princess III
- 2008 October 14th Tuesday (十月 十四日 火曜日)
- 2008 October 15th Wednesday (十月 十五日 水曜日)
- 1040 As Easy As A+B
- 2008 October 16th Thursday (十月 十六日 木曜日)
- 1049 Climbing Worm
- 1050 Moving Tables
- 2008 October 17th Friday (十月 十七日 金曜日)
- 严重: IOException while loading persisted sessions: java.io.EOFException