Harrison_001 @ 2023-09-29 16:49:17
#include<bits/stdc++.h>
#define int long long
using namespace std;
int p,res[510],a[510]={2};
void chen(int A[],int B[],int C[]){
int la=sizeof(A)/sizeof(A[0]),lb=sizeof(B)/sizeof(B[0]),lc=la+lb;
for(int i=0;i<la;i++){
for(int j=0;j<lb;j++){
C[i+j]+=A[i]*B[j];
C[i+j+1]+=C[i+j]/10;
C[i+j]%=10;
}
}
}
signed main(){
cin >>p;
cout <<(long long)(p*log10(2))+1 <<endl;
res[0]=1;
while(p){
int l[510];
memset(l,0,sizeof(l));
if(p&1){
chen(res,a,l);
int i=0;
while(l[i]){
res[i]=l[i];
i++;
}
}
memset(l,0,sizeof(l));
chen(a,a,l);
int i=0;
while(l[i]){
a[i]=l[i];
i++;
}
p>>=1;
}
res[0]--;
for(int i=499;i>=0;i--){
cout <<res[i];
}
return 0;
}