#include<bits/stdc++.h>
using namespace std;
long long k;
int x,y;
char s[100][100];
void build(int t){
if(t==2){
s[x][y]='X';
}
if(t==3){
s[x][y]=s[x+1][y]='X';
}
if(t==4){
s[x][y]=s[x+1][y]=s[x][y+1]='X';
}
if(t==5){
s[x][y]=s[x+1][y]=s[x][y+1]=s[x][y+2]='X';
}
if(t<6){
x+=2; y+=2; return;
}
s[x][y]=s[x+1][y]=s[x][y+1]=s[x+1][y+1]='X';
if(t==6){
s[x+2][y]='r'; s[x+2][y+1]='r';
s[x][y+2]='d'; s[x+1][y+2]='d';
}
if(t==7){
s[x+2][y]='X'; s[x+2][y+1]='r';
s[x][y+2]='d'; s[x+1][y+2]='d';
}
if(t==8){
s[x+2][y]='X'; s[x+2][y+1]='r';
s[x][y+2]='X'; s[x+1][y+2]='d';
}
if(t==9){
s[x+2][y]='r'; s[x+2][y+1]='X';
s[x][y+2]='d'; s[x+1][y+2]='d';
}
if(t==10){
s[x+2][y]='X'; s[x+2][y+1]='X';
s[x][y+2]='d'; s[x+1][y+2]='d';
}
if(t==11){
s[x+2][y]='X'; s[x+2][y+1]='X';
s[x][y+2]='X'; s[x+1][y+2]='d';
}
x+=2; y+=2;
}
int main(){
cin>>k;
x=1; y=1;
while(k>5){
build(k%6+6);
k/=6;
}
build(k);
x++; y++;
for(int i=1;i<=y;i++)s[x][i]='r';
for(int i=1;i<=x;i++)s[i][y]='d';
s[x][y]='.';
cout<<x<<" "<<y<<"\n";
for(int i=1;i<=x;i++){
for(int f=1;f<=y;f++){
if(s[i][f]==0)s[i][f]='.';
cout<<s[i][f];
}
cout<<"\n";
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
352 KB |
Correct! Your size: 4 |
2 |
Correct |
0 ms |
348 KB |
Correct! Your size: 4 |
3 |
Correct |
0 ms |
352 KB |
Correct! Your size: 4 |
4 |
Partially correct |
0 ms |
352 KB |
Partially Correct! Your size: 6 |
5 |
Partially correct |
1 ms |
352 KB |
Partially Correct! Your size: 6 |
6 |
Partially correct |
0 ms |
348 KB |
Partially Correct! Your size: 6 |
7 |
Partially correct |
0 ms |
348 KB |
Partially Correct! Your size: 6 |
8 |
Partially correct |
0 ms |
348 KB |
Partially Correct! Your size: 6 |
9 |
Partially correct |
0 ms |
348 KB |
Partially Correct! Your size: 6 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Correct! Your size: 48 |
2 |
Correct |
1 ms |
348 KB |
Correct! Your size: 48 |
3 |
Partially correct |
0 ms |
348 KB |
Partially Correct! Your size: 50 |
4 |
Correct |
0 ms |
348 KB |
Correct! Your size: 48 |
5 |
Correct |
0 ms |
360 KB |
Correct! Your size: 48 |
6 |
Partially correct |
0 ms |
388 KB |
Partially Correct! Your size: 50 |
7 |
Partially correct |
0 ms |
440 KB |
Partially Correct! Your size: 50 |
8 |
Correct |
0 ms |
348 KB |
Correct! Your size: 48 |