#include <iostream>
#include <cstdio>
#include <cstring>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#define LL long long
#define INF 0x3f3f3f3f
using namespace std;
LL a[65] = {0,1,2,3};
int main()
{
int n;
for(int i=4;i<=60;i++)
a[i] = a[i-1]+ a[i-3]+1;
while(cin>>n)
cout<<a[n]<<endl;
return 0;
}BestCoder Round #50 (div.2) 1003
最新推荐文章于 2024-09-28 09:20:52 发布
本文探讨了一个有趣的排列组合问题:如何计算在特定条件下,合法放置至少一个木俑的方法数量。通过递推公式实现了高效求解,并给出了具体实现代码。


126

被折叠的 条评论
为什么被折叠?



