#include using namespace std; //http://blog.livedoor.jp/kenyoi/archives/3995712.htmlをそのまま参考に int map[11][7]={0},type=0,x=2,y=1;//type=0東向き、1南向き、2西向き、3北向き char a[4],b[5]; void init(){ for(int i=1; i<=9; i++){ if(i%2){ cin>>a; for(int n=0; n<4; n++)map[i][n+1] = char(a[n])-'0'; } else { cin>>b; for(int m=0; m<5; m++)map[i][m+1] = char(b[m])-'0'; } } } int cxs[]={0,0,0,-1}; int cys[]={-1,0,1,0}; int dxs[]={ 0,1,0,-1}; int dys[]={-2,0,2, 0}; char muki[]="URDL"; void Round(){ int p; for(int i=type;i<4+type;i++){ p=i%4; if(map[y+cys[p]][x+cxs[p]]==1){ type=(p+3)%4; cout<