QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#399533 | #2817. 鸽鸽的分割 | ucup-team1251 | AC ✓ | 0ms | 3588kb | C++17 | 780b | 2024-04-26 14:27:52 | 2024-04-26 14:27:54 |
Judging History
answer
#include <bits/stdc++.h>
#define int long long
#define lson k<<1
#define rson (k<<1)|1
#define debug cout<<666<<endl;
using namespace std;
const int N=1e6+5;
int a[200],b[200],c[200],d[200];
void vision()
{
for(int i=1;i<=200;i++)
{
d[i]=i;
}
c[1]=1;
for(int i=2;i<=200;i++)
{
c[i]=c[i-1]+d[i-1];
}
b[1]=1;
for(int i=2;i<=200;i++)
{
b[i]=b[i-1]+c[i-1];
}
a[1]=1;
a[0]=1;
for(int i=2;i<=100;i++)
{
a[i]=a[i-1]+b[i-1];
}
int n;
while(cin>>n)
{
cout<<a[n]<<'\n';
}
return ;
}
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int t=1;
// cin>>t;
while(t--){
vision();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3588kb
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