제출 #1039053

#제출 시각아이디문제언어결과실행 시간메모리
1039053alexander707070Costinland (info1cup19_costinland)C++14
0 / 100
1 ms608 KiB
#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]='X'; 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]='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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...