#include <bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
using namespace std;
int n,m,k,i,j,ans,x,y;
char a[60][60];
int main() {
cin>>m;
i=1;
while(i*6<=m){
i*=6;
n++;
}
n*=2;
n+=3;
int p=m%6;
for(i = 1; i <= n; i++) for(j = 1; j <= n; j++)a[i][j]='.';
for(i=1; i<n; i++){a[i][n]='d'; a[n][i]='r';}
if(n)
for(i=1;i<n-3;i+=2){
a[i][i]=a[i+1][i]=a[i+1][i+1]=a[i][i+1]='X';
a[i+2][i]=a[i+2][i+1]='r';
a[i][i+2]=a[i+1][i+2]='d';
if(p==1)a[i+2][i]='X';
if(p==2)a[i+2][i]=a[i][i+2]='X';
if(p==3)a[i+2][i+1]='X';
if(p==4)a[i+2][i+1]=a[i+2][i]='X';
if(p==5)a[i+2][i+1]=a[i+2][i]=a[i][i+2]='X';
p=0; m/=6;
}
i=n-2;
if(m==2)a[i][i]='X';
if(m==3)a[i][i]=a[i+1][i]='X';
if(m==4)a[i][i]=a[i+1][i]=a[i][i+1]='X';
if(m==5){a[i][i]=a[i+1][i]=a[i+1][i+1]='X'; a[i][i+1]='d'; }
cout<< n <<" "<< n <<"\n";
for(i = 1; i <= n; i++){
for(j = 1; j <= n; j++){
cout<< a[i][j];
}
cout<<"\n";
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Correct! Your size: 3 |
2 |
Correct |
0 ms |
344 KB |
Correct! Your size: 3 |
3 |
Correct |
0 ms |
348 KB |
Correct! Your size: 3 |
4 |
Correct |
0 ms |
348 KB |
Correct! Your size: 5 |
5 |
Correct |
0 ms |
348 KB |
Correct! Your size: 5 |
6 |
Correct |
0 ms |
348 KB |
Correct! Your size: 5 |
7 |
Correct |
0 ms |
348 KB |
Correct! Your size: 5 |
8 |
Correct |
0 ms |
348 KB |
Correct! Your size: 5 |
9 |
Correct |
1 ms |
344 KB |
Correct! Your size: 5 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1061 ms |
348 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |