#include<iostream> #include<vector> #include<string> #include<map> using namespace std; struct cell_t { int wall[4]; bool memo; cell_t(){wall[0]=wall[1]=wall[2]=wall[3]=0;}; }; int turnR(int dir) { return (dir+1)%4; } int turnL(int dir) { return (4+dir-1)%4; } vector<string> split(const string &s) { vector<string> ret; int sep_pos = s.find_first_of(" "); ret.push_back(s.substr(0,sep_pos)); ret.pus