#include<bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(NULL);
cin.tie(NULL);
cout.tie(NULL);
long long k,br = 2,y = 1;
cin >> k;
while(2*y <= k) {
y*=2;
br++;
}
char ans[br][br];
for(long long i = 0; i < br; i++) {
for(long long j = 0; j < br; j++) {
ans[i][j] = '.';
}
}
for(long long i = 1; i < br-1; i++) {
ans[i][i] = 'X';
ans[i][i+1] = 'd';
ans[i+1][i] = 'r';
}
for(long long i = 0; i < br-1; i++) {
ans[br-1][i] = 'r';
ans[i][br-1] = 'd';
}
ans[0][0] = 'r';
for(long long i = 1; i < br-1; i++) {
y = (1LL << (br-i-1));
if(y&k) {
if(k%y == 0) {
ans[0][i] = 'd';
}
else {
ans[0][i] = 'X';
}
}
}
cout << br << " " << br << "\n";
for(long long i = 0; i < br; i++) {
for(long long j = 0; j < br; j++) {
cout << ans[i][j];
}
cout << "\n";
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
320 KB |
Correct! Your size: 3 |
2 |
Correct |
1 ms |
212 KB |
Correct! Your size: 4 |
3 |
Correct |
0 ms |
212 KB |
Correct! Your size: 4 |
4 |
Correct |
0 ms |
212 KB |
Correct! Your size: 4 |
5 |
Correct |
0 ms |
212 KB |
Correct! Your size: 4 |
6 |
Correct |
0 ms |
212 KB |
Correct! Your size: 5 |
7 |
Correct |
0 ms |
212 KB |
Correct! Your size: 5 |
8 |
Correct |
0 ms |
320 KB |
Correct! Your size: 5 |
9 |
Partially correct |
1 ms |
228 KB |
Partially Correct! Your size: 6 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
1 ms |
212 KB |
Partially Correct! Your size: 60 |
2 |
Partially correct |
1 ms |
212 KB |
Partially Correct! Your size: 60 |
3 |
Partially correct |
1 ms |
340 KB |
Partially Correct! Your size: 61 |
4 |
Partially correct |
1 ms |
212 KB |
Partially Correct! Your size: 61 |
5 |
Partially correct |
1 ms |
212 KB |
Partially Correct! Your size: 61 |
6 |
Partially correct |
1 ms |
212 KB |
Partially Correct! Your size: 61 |
7 |
Partially correct |
1 ms |
212 KB |
Partially Correct! Your size: 61 |
8 |
Partially correct |
0 ms |
212 KB |
Partially Correct! Your size: 59 |