#include #include #define NOT 1 #define AND 2 #define XOR 4 #define OR 8 struct _o { char c; int gatenum; } o[205][205]; int R,C; struct _g {char in[205]; int inlen; int inwant; int type, ox, oy;} g[70*70]; struct _out { int v, fill; } out[26]; int read_line() { int c, len=0; for (int i=0;i<205;i++) o[R][i].c=0, o[R][i].gatenum=0; o[R][0].c=0; while (c=getchar(), c!='\n' && c!=EOF) o[R][len].c=c, len++; if (o[R][0].c=='*') return 0; R++; if (len>C) C=len; return 1; } #define RIGHT 1 #define LEFT 0 #define UP 2 #define DOWN 3 struct _q { int x; int y; int v; int dir; } q[205*205]; int qs,qe; int main(void) { while (R=0, C=0, read_line()) { while (read_line()) ; for (int i=0;i<26;i++) out[i].fill=0; //1) gatefind int gates=0; for (int i=0;i=0 && nextx=0 && nexty=0 && nextx=0 && nexty