QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#276822#2817. 鸽鸽的分割SoyTonyAC ✓0ms3788kbC++14835b2023-12-06 11:14:302023-12-06 11:14:32

Judging History

你现在查看的是最新测评结果

  • [2023-12-06 11:14:32]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3788kb
  • [2023-12-06 11:14:30]
  • 提交

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