QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#276822 | #2817. 鸽鸽的分割 | SoyTony | AC ✓ | 0ms | 3788kb | C++14 | 835b | 2023-12-06 11:14:30 | 2023-12-06 11:14:32 |
Judging History
answer
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<queue>
#include<stack>
#include<vector>
#include<map>
using namespace std;
typedef long ll;
const ll maxn=105;
const ll mod=10007;
const ll base=10000;
const ll maxxn=0x7fffffff;
const ll minxn=-0x7fffffff;
inline ll read(){
ll x=0,w=1;char c=getchar();
while(c<'0'||c>'9'){if(c=='-')w=-1;c=getchar();}
while(c<='9'&&c>='0'){x=(x<<3)+(x<<1)+c-'0';c=getchar();}
return x*w;
}
ll n;
ll a[maxn],b[maxn],c[maxn],d[maxn];
int main(){
a[0]=b[0]=c[0]=d[0]=1;
for(int i=1;i<=64;i++){
a[i]=i+1;
b[i]=b[i-1]+a[i-1];
c[i]=c[i-1]+b[i-1];
d[i]=d[i-1]+c[i-1];
}
while(cin>>n){
if(!n){
printf("1\n");
}
else printf("%lld\n",d[n-1]);
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3788kb
input:
0 1 2 3 4 5 6 7 8 9 10 20 30 40 50 60 61 62 63 64
output:
1 1 2 4 8 16 31 57 99 163 256 5036 27841 92171 231526 489406 523686 559737 597619 637393
result:
ok 20 lines