#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]='X'; s[x+2][y+1]='X';
s[x][y+2]='d'; s[x+1][y+2]='d';
}
if(t==10){
s[x+2][y]='r'; s[x+2][y+1]='X';
s[x][y+2]='d'; s[x+1][y+2]='X';
}
if(t==11){
s[x+2][y]='X'; s[x+2][y+1]='X';
s[x][y+2]='d'; s[x+1][y+2]='X';
}
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 |
0 ms |
348 KB |
Correct! Your size: 4 |
2 |
Correct |
0 ms |
348 KB |
Correct! Your size: 4 |
3 |
Correct |
0 ms |
348 KB |
Correct! Your size: 4 |
4 |
Partially correct |
0 ms |
348 KB |
Partially Correct! Your size: 6 |
5 |
Partially correct |
0 ms |
348 KB |
Partially Correct! Your size: 6 |
6 |
Partially correct |
0 ms |
348 KB |
Partially Correct! Your size: 6 |
7 |
Incorrect |
0 ms |
348 KB |
The matrix does not generate the required number of Costins |
8 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
The matrix does not generate the required number of Costins |
2 |
Halted |
0 ms |
0 KB |
- |