# Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3675    Accepted Submission(s): 1830

Problem Description

Input

Output

Sample Input

1

3

12

Sample Output

1

5

81

Author

Gardon

Source

Gardon-DYGG Contest 2

```Recommend
JGShining
/
*#include<stdio.h>
#include<math.h>
int main()
{
long a[65];
a[1]=1;
long i,j,n,m,r;
for(i=2,j=1,r=1,m=2;i<66;i++,j++)
if(j<=m)
a[i]=a[i-1]+pow(2,r);
else
{
m++;
j=1;
r++;
a[i]=a[i-1]+pow(2,r);
}
while(scanf("%d",&n)==1){
printf("%d\n",a[n]);
}
return 0;
}*/
#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;
const int maxn=64;
int arr[maxn];
void func();
int main()
{
int n;
func();
while(cin>>n)
cout<<arr[n-1]<<endl;
return 0;
}
void func()
{
int i,j,k,m;
memset(arr,0,sizeof(arr));
k=*arr=1;
m=2;
for(i=1,j=0;i<maxn;i++,j++)
arr[j>=m?m++,j=0,k++:NULL,i]=arr[i-1]+(1<<k);
}```

657 篇文章64 人订阅

0 条评论

## 相关文章

2768

3519

2045

1833

### carla无人驾驶模拟中文项目 carla_simulator_Chinese

https://github.com/xfqbuaa/carla_simulator_Chinese

1273

2031

2838

### hdu----(1847)Good Luck in CET-4 Everybody!(简单巴什博奕)

Good Luck in CET-4 Everybody! Time Limit: 1000/1000 MS (Java/Others)    Memory L...

2544

### BZOJ 1008 越狱

1008: [HNOI2008]越狱 Time Limit: 1 Sec  Memory Limit: 162 MB Submit: 8681  Solved:...

3517

2682