留守新手村 @ 2020-03-09 14:24:34
// luogu-judger-enable-o2
// luogu-judger-enable-o2
#include<bits/stdc++.h>
#define MAXN 5000
using namespace std;
int main(){
int a[MAXN];
memset(a,0,sizeof(a));
int n;
a[0]=1;
scanf("%d",&n);
for(int i=0;i<n;i++){
for(int j=0;j<MAXN;j++)a[j]*=2;
for(int j=0;j<MAXN;j++){
a[j+1]+=a[j]/10;
a[j]=a[j]%10;
}
}
int k=MAXN-1;
while(a[k]==0)k--;
printf("%d\n",k+1);
a[0]--;
for(int i=499;i>=0;i--){
printf("%d",a[i]);
if(i%50==0)printf("\n");
}
}
by critnos @ 2020-03-09 14:28:02
压位&每次乘难以置信我竟然用这个跑了60ms
by ud2_ @ 2020-03-09 14:29:41
@留守新手村
by Prean @ 2020-03-09 15:00:55
众所周知这道题数据很小可以不用快速幂
by mazihang2022 @ 2020-03-09 15:20:20
@limaopipi2022
惊现AK IOI的lmpy神犇!