#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
char grid[61][61];
int main() {
cin.tie(0)->sync_with_stdio(0);
ll k;
cin >> k;
int w = (k <= 19 ? 6 : 61);
for (int i = 0; i < w; i++)
for (int j = 0; j < w; j++) grid[i][j] = '.';
for (int i = 0; i < w - 1; i++) {
grid[i][w - 2] = 'd';
grid[w - 1][i] = 'r';
}
grid[0][0] = 'r';
grid[w - 1][w - 2] = '.';
for (int i = 1; i < w - 1; i++)
for (int j = 0; j < w - 1 - i; j++)
grid[i][j] = 'X';
for (int i = 0; i < w - 1; i++)
if (k & (1ll << i)) grid[0][w - 2 - i] = 'X';
for (int i = w - 2; ~i; i--)
if (grid[0][i] == 'X') {
grid[0][i] = 'd';
break;
}
cout << w << ' ' << w - 1 << '\n';
for (int i = 0; i < w; i++) {
for (int j = 0; j < w - 1; j++) cout << grid[i][j];
cout << '\n';
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
1 ms |
204 KB |
Partially Correct! Your size: 6 |
2 |
Partially correct |
1 ms |
204 KB |
Partially Correct! Your size: 6 |
3 |
Partially correct |
1 ms |
204 KB |
Partially Correct! Your size: 6 |
4 |
Partially correct |
1 ms |
204 KB |
Partially Correct! Your size: 6 |
5 |
Partially correct |
1 ms |
204 KB |
Partially Correct! Your size: 6 |
6 |
Partially correct |
1 ms |
204 KB |
Partially Correct! Your size: 6 |
7 |
Partially correct |
1 ms |
204 KB |
Partially Correct! Your size: 6 |
8 |
Partially correct |
1 ms |
204 KB |
Partially Correct! Your size: 6 |
9 |
Partially correct |
1 ms |
204 KB |
Partially Correct! Your size: 6 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
1 ms |
204 KB |
Partially Correct! Your size: 61 |
2 |
Partially correct |
1 ms |
204 KB |
Partially Correct! Your size: 61 |
3 |
Partially correct |
1 ms |
204 KB |
Partially Correct! Your size: 61 |
4 |
Partially correct |
1 ms |
204 KB |
Partially Correct! Your size: 61 |
5 |
Partially correct |
1 ms |
204 KB |
Partially Correct! Your size: 61 |
6 |
Partially correct |
1 ms |
204 KB |
Partially Correct! Your size: 61 |
7 |
Partially correct |
1 ms |
204 KB |
Partially Correct! Your size: 61 |
8 |
Partially correct |
1 ms |
204 KB |
Partially Correct! Your size: 61 |