| 记录编号 | 382799 | 评测结果 | AAAAA | ||
|---|---|---|---|---|---|
| 题目名称 | 1415.[NOIP 2001]数的计算 | 最终得分 | 100 | ||
| 用户昵称 | 是否通过 | 通过 | |||
| 代码语言 | C++ | 运行时间 | 0.002 s | ||
| 提交时间 | 2017-03-14 19:02:22 | 内存使用 | 0.32 MiB | ||
#include<iostream>
#include<cstdio>
using namespace std;
int n,a[1010];
int main()
{
freopen("nums.in","r",stdin);
freopen("nums.out","w",stdout);
scanf("%d",&n);
a[1]=1;
a[2]=2;
for(int i=3;i<=n;i++)
{
for(int j=1;j<=i/2;j++)
a[i]+=a[j];
a[i]+=1;
}
printf("%d",a[n]);
return 0;
}