#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <ctype.h>
int main(){
int n;
scanf("%d", &n);
int ppp = int(log10(2) * n);
printf("%d\n", ppp+1);
int profile[505] = {0};
profile[0] = 1;
int flag = 1;
for (int i = 0; i < n;i++){
for (int u = flag-1; u >=0;u--){
profile[u] = profile[u] * 2;
if(profile[u]>=10){
profile[u + 1]++;
profile[u] = profile[u] - 10;
}
}
for (int y = 0; y < flag;y++){
if(profile[y]>=10){
profile[y + 1]++;
profile[y] = profile[y] - 10;
}
}
if((profile[flag]!=0)&&(flag<500)){
flag++;
}
}
profile[0]--;
int y = 0;
while(profile[y]<0){
profile[y] = profile[y] + 10;
profile[y + 1]--;
y++;
}
for (int x = 499; x >= 0; x--)
{
printf("%d", profile[x]);
}
}
自己电脑能过,基本没问题,但是提交上去是编译错误