#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main () {
long long k = 0;
cin >> k;
int largestbit = 0;
for (int i = 60; i >= 0; i--)
if ((k & (1ll << i))) {
largestbit = i;
break;
}
int siz = max (
largestbit + 1,
5
);
vector <string> gr (siz, string (siz, '.'));
for (int i = 0; i < largestbit; i++) {
gr[i][i] = 'X';
gr[i + 1][i] = 'r';
gr[i][i + 1] = 'd';
}
for (int i = 0; i < siz - 1; i++) {
gr[siz - 1][i] = 'r';
gr[i][siz - 1] = 'd';
}
for (int i = 2; i < largestbit; i++)
if ((k & (1ll << i))) {
gr[i][i - 1] = 'X';
gr[i - 1][i] = 'X';
}
if ((k & 3ll)) {
gr[1][0] = 'X';
gr[0][1] = 'X';
gr[siz - 2][0] = 'X';
gr[siz - 2][1] = 'd';
} else if ((k & 2ll)) {
gr[1][0] = 'X';
gr[0][1] = 'X';
} else if ((k & 1ll)) {
gr[1][0] = 'X';
}
for (int y = 0; y < siz; y++)
cout << gr[y] << '\n';
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Expected integer, but "XX..d" found |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Expected integer, but "XX........................................................d" found |
2 |
Halted |
0 ms |
0 KB |
- |