/* p5.cpp This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ //guzixi ak csp-j //guzixi ak csp-s //guzixi ak noip //guzixi ak shenxuan //guzixi ak noi //guzixi ak wc //guzixi ak ctsc //guzixi ak ioi //guzixi ak xxywl //while(1) rp+=1145141919810; #include <bits/stdc++.h> //#include <bits\stdc++.h> using namespace std; int a[222][222],x=111,y=111,mi_x=111, ma_x=111,mi_y=111,ma_y=111; int d[4][2]= {1,0,0,1,-1,0,0,-1},nd; string xxx; int left() { cout<<"LEFT"<<endl; nd=(nd+1)%4; cin>>xxx; return nd; } bool go() { cout<<"GO"<<endl; cin>>xxx; return xxx=="SUCC"; } void dfs(int dd){ x-=d[dd][0],y-=d[dd][1]; while(left()!=0); for(int i=0;i<4;i++){ if(a[x+d[i][0]][y+d[i][1]]==0){ if(go()){ mi_x=min(mi_x,x+d[i][0]); mi_y=min(mi_y,y+d[i][1]); ma_x=max(ma_x,x+d[i][0]); ma_y=max(ma_y,y+d[i][1]); a[x+d[i][0]][y+d[i][1]]=1; dfs((i+2)%4); } else a[x+d[i][0]][y+d[i][1]]=-1; } left(); } while(left()!=dd); go(); while(left()!=(dd+2)%4); x+=d[dd][0],y+=d[dd][1]; } void mian() { dfs(nd); cout << "END" << endl; cout << ma_x-mi_x+1 << " " << ma_y-mi_y+1 << endl; for (int i = mi_x; i <= ma_x; i++) { for (int j = mi_y; j <= ma_y; j++) { if(a[i][j]==1)cout<<'.'; else cout<<'#'; } cout << endl; } } int main() { string s; cout<<"LEFT"<<endl; cin>>s; if(s=="W")nd=3; if(s=="E")nd=1; if(s=="S")nd=0; else nd=2; mian(); return 0; } void man(); //guzixi luogu uid = 1124559, welcome //love ccf, love jiangsu