#include <iostream>
#include <cmath>
using namespace std;
int main() 
{
    int p;
    cin>>p;
    int dig;
    dig=(int)(p*log10(2)+1e-9)+1;
    cout<<dig<<endl;
    int a[500]={0};
    a[0]=1;
    for(int i=0;i<p;i++)
        {
            int temp=0;
            for(int j=0;j<500;j++)
                {
                    a[j]=a[j]*2+temp;
                    temp=a[j]/10;
                    a[j]%=10;
                }
        }
    a[0]--;
    for(int i=0;i<500;i++)
        {
            cout<<a[499-i];
            if((i+1)%50==0)
                cout<<endl;
        }
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: