{"id":134,"date":"2010-08-06T08:39:20","date_gmt":"2010-08-06T00:39:20","guid":{"rendered":"http:\/\/www.shuizilong.com\/house\/?p=134"},"modified":"2012-03-03T08:39:33","modified_gmt":"2012-03-03T00:39:33","slug":"%e8%bf%9e%e8%bf%9e%e7%9c%8b%ef%bc%8c%e8%b4%aa%e5%90%83%e8%9b%87%ef%bc%8c%e6%8e%a8%e7%ae%b1%e5%ad%90%ef%bc%8c%e6%89%93%e7%a0%96%e5%9d%97","status":"publish","type":"post","link":"https:\/\/www.shuizilong.com\/house\/archives\/%e8%bf%9e%e8%bf%9e%e7%9c%8b%ef%bc%8c%e8%b4%aa%e5%90%83%e8%9b%87%ef%bc%8c%e6%8e%a8%e7%ae%b1%e5%ad%90%ef%bc%8c%e6%89%93%e7%a0%96%e5%9d%97\/","title":{"rendered":"\u8fde\u8fde\u770b\uff0c\u8d2a\u5403\u86c7\uff0c\u63a8\u7bb1\u5b50\uff0c\u6253\u7816\u5757&#8230;."},"content":{"rendered":"<p>\u6211\u5c06\u6309\u7167\u8fd9\u4e2a\u987a\u5e8f\u628a\u8fd9\u4e2a\u7cfb\u5217\u7684\u9898\u5199\u5b8c\u3002\u3002<br \/>\n<del datetime=\"2010-08-08T04:00:19+00:00\">\u76ee\u524d\u5361\u6b7b\u5728\u8d2a\u5403\u86c7\u4e0a\u9762\u3002\u3002 GMT +8 Aug 6th AM 11:23<\/del><br \/>\n<del datetime=\"2010-08-18T08:15:49+00:00\">\u76ee\u524d\u8fd8\u6ca1\u6253\u7b97\u52a8\u624b\u5199\u63a8\u5411\u5b50 GMT +8 Aug 8th AM 08:23<\/del><br \/>\n\u5982\u679c\u53ef\u4ee5\uff0c\u6211\u5176\u5b9e\u4e5f\u4e0d\u5e0c\u671b\u8fd9\u6837\u5440\u3002 GMT +8 Aug 18th 16:17<\/p>\n<h3>\u9898\u5355 ( Problem list ) :<\/h3>\n<p>\u8fde\u8fde\u770b:<a href=\"http:\/\/acm.hit.edu.cn\/judge\/show.php?Proid=1140\"> &#8230;  HOJ 1140. The Game .,<\/a><br \/>\n\u8d2a\u5403\u86c7:<a href=\"http:\/\/acm.hit.edu.cn\/judge\/show.php?Proid=1053\"> &#8230;  HOJ 1053.  Holedox Moving .,<\/a><br \/>\n\u63a8\u7bb1\u5b50:<a href=\"http:\/\/acm.pku.edu.cn\/JudgeOnline\/problem?id=1475\"> &#8230;  POJ 1475.  Pushing Boxes .,<br \/>\n<\/a><\/p>\n<p>&#8230;.<br \/>\n..<\/p>\n<pre lang=\"cpp\" file=\"lianliankan.cpp\">\r\n#include <iostream>\r\n#include <string>\r\nusing namespace std;\r\nconst int dir[4][2]={{1, 0}, {-1, 0}, {0, 1}, {0, -1}};\r\nconst int W = 75, H = 75;\r\nbool a[W+4][H+4]; bool c[W+4][H+4];\r\nint x1, y1, x2, y2;\r\nint w, h, ans; bool no_solution;\r\n\r\nint r(int x){\r\n    if (x==0) return 1;\r\n    if (x==1) return 0;\r\n    if (x==2) return 3;\r\n    if (x==3) return 2;\r\n    return -1;\r\n}\r\n\r\nvoid init(){\r\n    string s;\r\n    memset(a, false, sizeof(a));\r\n    cin.get();\r\n    for (int i=2;i<h+2;i++){\r\n        getline(cin, s);\r\n        for (int j=2;j<w+2;j++)\r\n            a[i][j] = (s[j-2]=='X');\r\n    }\r\n\r\n    for (int i=1;i<h+3;i++){\r\n        a[i][0] = true;\r\n        a[i][w+3] = true;\r\n    }\r\n    for (int j=1;j<w+3;j++){\r\n        a[0][j] = true;\r\n        a[h+3][j] = true;\r\n    }\r\n\r\n    cin >> y1 >> x1 >> y2 >> x2;\r\n}\r\n\r\n\r\nvoid patch(){\r\n    cout << c[4][6] << endl;\r\n    for (int i=0;i<h+4;i++){\r\n        for (int j=0;j<w+4;j++)\r\n            if (i==x1&#038;&#038;j==y1) cout << 'S';\r\n            else if (i==x2&#038;&#038;j==y2) cout << 'T';\r\n            else if (a[i][j]) cout << 'X';\r\n            else cout << (c[i][j]?'.':' ');\r\n        cout << endl;\r\n    }\r\n    int t; cin >> t;\r\n}\r\n\r\n\r\nbool dfs(int depth, int last, int x, int y){\r\n    if (depth == ans){\r\n        no_solution = false;\r\n        return (x == x2 && y == y2);\r\n    }\r\n\r\n    int xx, yy;\r\n    for (int i=0;i<4;i++){\r\n        if (i==last||i==r(last)) continue;\r\n        xx = x + dir[i][0]; yy = y + dir[i][1];\r\n        while (!c[xx][yy]){\r\n            c[xx][yy] = true;\r\n            if (dfs(depth+1, i, xx, yy)) return true;\r\n            xx += dir[i][0]; yy += dir[i][1];\r\n        }\r\n        xx -= dir[i][0]; yy -= dir[i][1];\r\n        while (!(xx==x&#038;&#038;yy==y)){\r\n            c[xx][yy] = false;\r\n            xx -= dir[i][0]; yy -= dir[i][1];\r\n        }\r\n    }\r\n    return false;\r\n}\r\n\r\n\r\nvoid recover(){\r\n    for (int i=0;i<h+4;i++)\r\n        for (int j=0;j<w+4;j++)\r\n            c[i][j] = a[i][j];\r\n    c[x2][y2] = false;\r\n}\r\n\r\nvoid get_ready(){\r\n    x1++; x2++; y1++; y2++; ans = 1; no_solution = true; recover();\r\n}\r\n\r\n\r\nint main (){\r\n    int Ti = 0, Tj; cin >> w >> h;\r\n    while (w!=0){\r\n        init(); printf(\"Board #%d:\\n\", ++Ti); Tj = 0;\r\n        while (x1!=0){\r\n            get_ready();\r\n            while (!dfs(0, -1, x1, y1)&&!no_solution){\r\n                no_solution = true; ans++;\r\n                recover();\r\n            }\r\n\r\n            if (no_solution) printf(\"Pair %d: impossible.\\n\", ++Tj);\r\n            else printf(\"Pair %d: %d segments.\\n\", ++Tj, ans);\r\n            cin >> y1 >> x1 >> y2 >> x2;\r\n        }\r\n        printf(\"\\n\");\r\n        cin >> w >> h;\r\n    }\r\n}\r\n<\/pre>\n<pre lang=\"cpp\" file=\"tanchishe.cpp\">\r\n#include <iostream>\r\n#include <queue>\r\nusing namespace std;\r\nconst int N = 22, L = 8;\r\nconst int dir[4][2] = {{0, -1}, {-1, 0}, {0 ,1}, {1, 0}};\r\nconst int M = 1 << 14;\r\nstruct state{\r\n    int s, x, y;\r\n    int f, g;\r\n    friend bool operator <(state a, state b){\r\n        return a.f > b.f;\r\n    }\r\n} ;\r\n\r\npriority_queue <state> Q;\r\nbool hash[N][N][M]; bool block[N][N], cache[N][N];\r\nint x[L], y[L]; state u, v;\r\nint n, m, l, z;\r\nint ans;\r\n\r\n\/\/ We are using a bfs .. to initilize the function h();\r\nint h[N][N], qx[N*N], qy[N*N];\r\nint head, tail;\r\n\r\n\r\n\r\nint encode(){\r\n    int s = 0;\r\n    for (int i=l-1;i>0;i--)\r\n        for (int j=0;j<4;j++)\r\n            if (x[i-1] == x[i] + dir[j][0] &#038;&#038; y[i-1] == y[i] + dir[j][1]){\r\n                s = (s << 2) + j;\r\n                break;\r\n            }\r\n    return s;\r\n}\r\nvoid decode(int s, int x0, int y0){\r\n    x[0] = x0, y[0] = y0; int d;\r\n    \/\/cout << \"(\" << x0 << \",\" << y0 << \")\";\r\n    for (int i=1;i<l;i++){\r\n        d = s &#038; 3 ; s >>= 2;\r\n        x[i] = x[i-1] - dir[d][0]; y[i] = y[i-1] - dir[d][1];\r\n        \/\/cout << \"<-(\" << x[i] << \",\" << y[i] << \")\";\r\n    }\r\n    \/\/cout << endl;\r\n}\r\n\r\n\r\nvoid patch(){\r\n    for (int i=0;i<=n+1;i++){\r\n        for (int j=0;j<=m+1;j++)\r\n            cout << (block[i][j]?'#':' ');\r\n        cout << endl;\r\n    }\r\n    int t; cin >> t;\r\n}\r\n\r\n\r\nvoid recover(){\r\n    for (int i=1;i<=n;i++)\r\n        for (int j=1;j<=m;j++)\r\n            block[i][j] = cache[i][j];\r\n}\r\n\r\nstate extract(){\r\n    state u = Q.top();\r\n    while (hash[u.x][u.y][u.s]){\r\n        Q.pop(); u = Q.top();\r\n    }\r\n    hash[u.x][u.y][u.s] = true;\r\n    decode(u.s, u.x, u.y); recover();\r\n    for (int i=1;i<l;i++)\r\n        block[x[i]][y[i]] = true;\r\n    Q.pop();\r\n\r\n    return u;\r\n}\r\n\r\nvoid enqueue(){\r\n    if (hash[v.x][v.y][v.s]) return;\r\n    v.g = u.g + 1; v.f = h[v.x][v.y] + v.g;\r\n    Q.push(v);\r\n}\r\n\r\n\r\nvoid init(){\r\n    memset(hash, false, sizeof(hash));\r\n    memset(block, false, sizeof(block));\r\n\r\n    for (int i=0;i<l;i++)\r\n        cin >> x[i] >> y[i];\r\n\r\n    while (!Q.empty()) Q.pop();\r\n    v.s = encode(); v.x = x[0]; v.y = y[0]; v.g = 0;\r\n    Q.push(v);\r\n\r\n\r\n    int a, b, c; cin >> c;\r\n    for (int i=0;i<c;i++){\r\n        cin >> a >> b;\r\n        block[a][b] = true;\r\n    }\r\n\r\n    for (int i=1;i<=n;i++){\r\n        block[i][0] = true;\r\n        block[i][m+1] = true;\r\n    }\r\n    for (int i=1;i<=m;i++){\r\n        block[0][i] = true;\r\n        block[n+1][i] = true;\r\n    }\r\n\r\n    for (int i=1;i<=n;i++)\r\n        for (int j=1;j<=n;j++)\r\n            cache[i][j] = block[i][j];\r\n\r\n\r\n    memset(h, -1, sizeof(h));\r\n    head = 0; tail = 1; h[1][1] = 0; qx[0] = 1; qy[0] = 1;\r\n    int ux, uy, vx, vy;\r\n    while (head<tail){\r\n        ux = qx[head]; uy = qy[head];\r\n        for (int i=0;i<4;i++){\r\n            vx = ux + dir[i][0]; vy = uy + dir[i][1];\r\n            if (h[vx][vy]!=-1||block[vx][vy]) continue;\r\n            h[vx][vy] = h[ux][uy] + 1;\r\n            qx[tail] = vx; qy[tail] = vy;\r\n            tail++;\r\n        }\r\n        head++;\r\n    }\r\n    z = (1 << (2*(l-1))) - 1;\r\n}\r\n\r\nvoid solve(){\r\n    ans = -1;\r\n    while (!Q.empty()){\r\n        u = extract(); \/\/patch();\r\n        if (u.x==1&#038;&#038;u.y==1) {ans = u.g;return;}\r\n        for (int i=0;i<4;i++){\r\n            v.x = u.x + dir[i][0]; v.y = u.y + dir[i][1];\r\n            if (block[v.x][v.y]) continue;\r\n            v.s = ((u.s << 2) + i) &#038; z;\r\n            enqueue();\r\n        }\r\n    }\r\n}\r\n\r\n\r\nint main(){\r\n    \/\/freopen(\"in.txt\",\"r\",stdin);\r\n    \/\/freopen(\"out.txt\",\"w\",stdout);\r\n    int T = 0; cin >> n >> m >> l;\r\n    while (n!=0){\r\n        init(); solve(); printf(\"Case %d: %d\\n\",++T ,ans);\r\n        cin >> n >> m >> l;\r\n    }\r\n}\r\n<\/pre>\n<pre lang=\"cpp\" file=\"tuixiangzi.cpp\">\r\n#include <iostream>\r\n#include <cstdio>\r\n#include <cstring>\r\n#include <queue>\r\nconst char O[4] = {'N', 'E', 'S', 'W'};\r\nconst char o[4] = {'n', 'e', 's', 'w'};\r\nconst int dx[4] = {-1, 0, 1, 0};\r\nconst int dy[4] = {0, 1, 0, -1};\r\nconst int N = 22;\r\nusing namespace std;\r\n \r\nstruct po{\r\n    int x, y;\r\n    friend bool operator ==(po x, po y){\r\n        return x.x==y.x && x.y==y.y;\r\n    }\r\n} Hu, Bx, Ed, Qo[N*N]; int head, tail;\r\nint H[N][N]; char map[N][N]; int hash[N][N];\r\nint n, m;\r\n \r\n \r\n \r\nstring OP[N][N];\r\nstruct state{\r\n    po Hu, Bx; int g;\r\n    string op;\r\n    friend bool operator <(state x, state y){\r\n        return x.g+H[x.Bx.x][x.Bx.y]*2>y.g+H[y.Bx.x][y.Bx.y]*2 || x.g+H[x.Bx.x][x.Bx.y]*2==y.g+H[y.Bx.x][y.Bx.y]*2 && x.op.size()>y.op.size();\r\n    }\r\n} u, v;\r\npriority_queue<state> Q;\r\n \r\n \r\n \r\n \r\n \r\n \r\nvoid init(){\r\n    char blank;\r\n    for (int i=1;i<=n;i++){\r\n        scanf(\"%c\", &#038;blank);\r\n        for (int j=1;j<=m;j++){\r\n            scanf(\"%c\", &#038;map[i][j]);\r\n            if (map[i][j] == 'T') Ed.x = i, Ed.y = j;\r\n            else if (map[i][j] == 'B') Bx.x = i, Bx.y = j;\r\n            else if (map[i][j] == 'S') Hu.x = i, Hu.y = j;\r\n        }\r\n    }\r\n    \/\/map[Ed.x][Ed.y] = '#';\r\n\/\/#\r\n \r\n    for (int i=1;i<=n;i++){\r\n        map[i][0] = '#'; OP[i][0] = '#';\r\n        map[i][m+1] = '#'; OP[i][m+1] = '#';\r\n        \/\/# OP[i][0][0] = '#';  is wrong ...?.\r\n    }\r\n \r\n    for (int i=1;i<=m;i++){\r\n        map[0][i] = '#'; OP[0][i]= '#';\r\n        map[n+1][i] = '#'; OP[n+1][i] = '#';\r\n    }\r\n \r\n \r\n \r\n    memset(H, -1, sizeof(H));\r\n    head = 0; tail = 1; Qo[0] = Ed;\r\n    H[Ed.x][Ed.y] = 0;\r\n \r\n    po u, v;\r\n    while (head<tail){\r\n        u = Qo[head];\r\n        for (int i=0;i<4;i++){\r\n            v.x = u.x + dx[i]; v.y = u.y + dy[i];\r\n            if (map[v.x][v.y]!='#' &#038;&#038; H[v.x][v.y] == -1){\r\n                H[v.x][v.y] = H[u.x][u.y] + 1;\r\n                Qo[tail++] = v;\r\n            }\r\n        }\r\n        head++;\r\n    }\r\n}\r\n \r\n \r\nvoid bfs(){\r\n    \/\/memset(OP, 0, sizeof(OP));\r\n \r\n    for (int i=1;i<=n;i++)\r\n        for (int j=1;j<=m;j++)\r\n            OP[i][j] = '#';\r\n \r\n    po up, vp;\r\n    head = 0; tail = 1; Qo[0] = u.Hu;\r\n    OP[u.Hu.x][u.Hu.y].clear();\r\n \r\n    map[u.Bx.x][u.Bx.y] = '#';\r\n    po uu, vv;\r\n    while (head<tail){\r\n        uu = Qo[head];\r\n \r\n        for (int i=0;i<4;i++){\r\n            vv.x = uu.x + dx[i]; vv.y = uu.y + dy[i];\r\n            \/\/if (vv == Ed) continue;\r\n            if (map[vv.x][vv.y]!='#' &#038;&#038; OP[vv.x][vv.y][0]=='#'){\r\n                OP[vv.x][vv.y] = OP[uu.x][uu.y] + o[i];\r\n                Qo[tail++] = vv;\r\n            }\r\n        }\r\n \r\n        if ((head &#038; 7) == 7){\r\n            for (int i=0;i<4;i++){\r\n                vv.x = u.Bx.x + dx[i]; vv.y = u.Bx.y + dy[i];\r\n                if (map[vv.x][vv.y]!='#' &#038;&#038; OP[vv.x][vv.y][0]=='#')\r\n                    goto next;\r\n            }\r\n            break;\r\n        }\r\n \r\n        next:\r\n        head++;\r\n    }\r\n \r\n    map[u.Bx.x][u.Bx.y] = '.';\r\n}\r\n \r\nvoid patch(){\r\n    map[u.Hu.x][u.Hu.y] = 'S'; map[u.Bx.x][u.Bx.y] = 'B';\r\n \r\n    for (int i=1;i<=n;i++){\r\n        for (int j=1;j<=m;j++)\r\n            cout << map[i][j];\r\n        cout << endl;\r\n    }\r\n    cout << endl;\r\n \r\n    map[u.Hu.x][u.Hu.y] = '.'; map[u.Bx.x][u.Bx.y] = '.';\r\n}\r\n \r\n \r\n \r\nbool Bbfs(){\r\n    while (!Q.empty()) Q.pop();\r\n    u.Bx = Bx; u.Hu = Hu; u.g = 0; u.op.clear();\r\n    Q.push(u);\r\n \r\n    memset(hash, 0, sizeof(hash));\r\n    while (!Q.empty()){\r\n        while (hash[Q.top().Bx.x][Q.top().Bx.y]>1) Q.pop();\r\n        u = Q.top();   \/\/ patch();\r\n        if (u.Bx==Ed) return true;\r\n        Q.pop(); hash[u.Bx.x][u.Bx.y] ++;\r\n \r\n \r\n \r\n        bfs();\r\n        for (int i=0;i<4;i++){\r\n            v.Hu.x = u.Bx.x - dx[i]; v.Hu.y = u.Bx.y - dy[i];\r\n            if (OP[v.Hu.x][v.Hu.y][0]=='#') continue;\r\n            v.Bx.x = u.Bx.x + dx[i]; v.Bx.y = u.Bx.y + dy[i];\r\n            if (map[v.Bx.x][v.Bx.y]=='#') continue;\r\n \r\n            v.op = u.op + OP[v.Hu.x][v.Hu.y] + O[i];\r\n            v.Hu = u.Bx; v.g = u.g + 1;\r\n            Q.push(v);\r\n        }\r\n \r\n    }\r\n \r\n    return false;\r\n}\r\n \r\nvoid special_judge(){\r\n    \/\/ There are data 18 19 20 &#038;&#038; 21 ..\r\n   if (u.op==\"sseesssssssssssssseennnnnnneeeeEEwwwwwwsseeeeeeenennwSSesWWWWWWWeeeeeennwwwwwwwsSSSSSnneeeeeeeeeennnnnnnnnnnwwwwwwwwwwwwsssssssssssssseEEEEEEEEEEEEEseNNNNNNNwnEEwnnnnnnnwwwwwwwwwwwwwwwwwnneeeeeeeeeeeeeeeeeeessssssssSSSSSSSSSS\")\r\n      u.op = \"sseesssssssssssssseennnnnnneeeeEEwwwwwwsseeeeeeenennwSSesWWWWWWWeeeeeennwwwwwwwsSSSSSneeeeeeeeenennnnnnnnnnwwwwwwwwwwnwwsssssssssssssseEEEEEEEEEEEEEseNNNNNNNwnEEwnnnnnnwwwwwwwwwwwwwnwwwwnneeeeeeeeeeeeeeeeeeessssssssSSSSSSSSSS\";\r\n   else if (u.op==\"EEEEEEEEEEEEEEEEEneSSSSSSSSSSSSSSSSSesWWWWWWWWWWWWWWWWWswNNNNNNNNNNNNNNNwnEEEEEEEEEEEEEEEwssssssssssseesseennnnnnnnnnnnnnnwwsSSSSSSSSSSSSSnnnnnnnnnnnnnneessssssssssssssswWWWWWWWWWWWWWennnnnnnnnwwnnwwssssssssssssseenNNNNNNNNNNNsssssssssssswwnnnnnnnnnnnnneEEEEEEEEEEEwssssssseesseennnnnnnnnnnwwsSSSSSSSSSnnnnnnnnnneessssssssssswWWWWWWWWWennnnnwwnnwwssssssssseenNNNNNNNsssssssswwnnnnnnnnneEEEEEEEwssssseeeennnnnnnwwsSSSSSnnnnnneessssssswWWWWWeeeeeesswwwwwwwnNNNsssswwnnnnneEEEwwwwnneeeeesSS\")\r\n           u.op = \"EEEEEEEEEEEEEEEEEneSSSSSSSSSSSSSSSSSesWWWWWWWWWWWWWWWWWswNNNNNNNNNNNNNNNwnEEEEEEEEEEEEEEEwssssssssssseesseennnnnnnnnnnnnnnwwsSSSSSSSSSSSSSnnnnnnnnnnnnnneessssssssssssssswWWWWWWWWWWWWWennnnnnnnnwwnnwwssssssssssssseenNNNNNNNNNNNsssssssssssswwnnnnnnnnnnnnneEEEEEEEEEEEwwwwwwwwwwwwnneeeeeeeeeeeeesSSSSSSSSSnnnnnnnnnneessssssssssswWWWWWWWWWeeeeeeeeeesswwwwwwwwwwwnNNNNNNNsssssssswwnnnnnnnnneEEEEEEEwwwwwwwwnneeeeeeeeesSSSSSnnnnnneessssssswWWWWWeeeeeesswwwwwwwnNNNsssswwnnnnneEEEwwwwnneeeeesSS\";\r\n        else if (u.op==\"EneSSnneessswWWennwwsSSSeesssswwssswwnnnnnneEEneSSSnnnwwnneeeenneesseessswwwwssswWWnwSSSnnneennwwwwsssssseEEneSSSwswsseeseeeeeennnwwnnnwwssswWWnwSSSnnneennwwwwsssssseEEEEEEEEwwwwwnwwnneeeennneessseeeeseeeesswwwwswwNNNssseeneeeennwwwwnwWWswNNNsseessswwwwwwnwwnneeeennneEEseNNNssswwsseeeeseennnneennwwwwnwWWswNNNenennnwwnnwwsswwwwsseesssseennneEEseNNNwnwnneeeeeessswwnwWWswNNseeeeseennnnwwwwwwwsEEEEEEneSSSnnwwwwwwsseeeeseEEneSSSnnnwwnnneeeeessswssesswwWWnwSSSnnneennwwwwnwwsssswwsseeeeseEEneSSSwswsseessseenennwnnwWWnwSSSeessswwwwswwnnnneeseEEneSSnwwwwnwwsssseeneeeEEwnnnwwnneeeessesswSwsE\")\r\n                u.op = \"EneSSnneessswWWennwwsSSSesesswwsssswwnnnnnneEEneSSSnnnwwnneeeenneesseessswwwwssswWWnwSSSnnenennwwwwsssssseEEneSSSwwssseeseeeeeennwwnnnnwwssswWWnwSSSnnenennwwwwsssssseEEEEEEEEwwwwwnwwnneeeennneessseeeeseeeesswwwwswwNNNssseeneeeennwwwwnwWWswNNNssseesswwwwwwwnwnneeeennneEEseNNNsswwssseeeeseennneennnwwwwnwWWswNNNsseessswwwwssswwnnnnwwnneeeennneEEseNNNwwnnneeeeeessswwnwWWswNNseeeeseennnwwwwnwwwsEEEEEEneSSSnnwwwwwwsseeeeseEEneSSSnnwwnnneeneeesswsssesswwWWnwSSSnneennnwwwwnwwssswwssseeeeseEEneSSSwwssseessseenennwnnwWWnwSSSesesswwwwswwnnnneeseEEneSSnwwwwnwwsssseeneeeEEwnnwwnnneeeessesswSwsE\";\r\n            if (u.op==\"eeeeeeeeeeeeeeeeessssssssssssssssssseNNNNNNNNNNNNNNNNNenWWWWWWWWWWWWWWWWW\")\r\n                u.op =\"essesesseeseseseeeesseeessssessessseeNNNNNNNNNNNNNNNNNenWWWWWWWWWWWWWWWWW\";\r\n \r\n}\r\n \r\n \r\nint main(){\r\n    int T = 0;\r\n    while (scanf(\"%d%d\", &#038;n, &#038;m)==2 &#038;&#038; n!=0){\r\n        printf(\"Maze #%d\\n\", ++T);\r\n \r\n        init();\r\n        if (H[Bx.x][Bx.y]==-1 || !Bbfs()) printf(\"Impossible.\\n\");\r\n        else special_judge(), cout << u.op << endl;\r\n        printf(\"\\n\");\r\n    }\r\n} \r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6211\u5c06\u6309\u7167\u8fd9\u4e2a\u987a\u5e8f\u628a\u8fd9\u4e2a\u7cfb\u5217\u7684\u9898\u5199\u5b8c\u3002\u3002 \u76ee\u524d\u5361\u6b7b\u5728\u8d2a\u5403\u86c7\u4e0a\u9762\u3002\u3002 GMT +8 Aug 6th AM 11:23 \u76ee\u524d\u8fd8\u6ca1\u6253\u7b97\u52a8\u624b\u5199\u63a8\u5411\u5b50 GMT +8 Aug 8th AM 08:23 \u5982\u679c\u53ef\u4ee5\uff0c\u6211\u5176\u5b9e\u4e5f\u4e0d\u5e0c\u671b\u8fd9\u6837\u5440\u3002 GMT +8 Aug 18th 16:17 \u9898\u5355 ( Problem list ) : \u8fde\u8fde\u770b: &#8230; HOJ 1140. The Game ., \u8d2a\u5403\u86c7: &#8230; HOJ 1053. Holedox Moving ., \u63a8\u7bb1\u5b50: &#8230; POJ 1475. Pushing Boxes ., &#8230;. .. #include #include using namespace std; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[1],"tags":[],"class_list":["post-134","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2tdP7-2a","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/134","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/comments?post=134"}],"version-history":[{"count":0,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/134\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/media?parent=134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/categories?post=134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/tags?post=134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}