显示原始代码
#include <bits/stdc++.h>
using namespace std;
#define int long long
inline int read() {
int x = 0, f = 1;
char c = getchar();
while (c < '0' || c > '9') {
if (c == '-')
f = -1;
c = getchar();
}
while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
return x * f;
}
int qpow(int x, int k) {
int res = 1;
while (k) {
if (k & 1)
res *= x;
x *= x;
k >>= 1;
}
return res;
}
signed main() {
int n = read();
int ans = qpow(2, n) - 1;
int a[505], p = 0;
while (ans > 0) {
a[++p] = ans % 10;
ans /= 10;
}
printf("%d\n", p);
for (int i = 1; i <= 500 - p; i++) {
putchar('0');
if (i % 50 == 0)
putchar('\n');
}
for (int i = p; i; i--) {
printf("%d", a[i]);
if ((500 - i + 1) % 50 == 0)
putchar('\n');
}
return 0;
}