結果

問題 No.323 yuki国
ユーザー roiti46roiti46
提出日時 2015-12-16 00:29:31
言語 PyPy2
(7.3.15)
結果
TLE  
実行時間 -
コード長 699 bytes
コンパイル時間 1,618 ms
コンパイル使用メモリ 77,424 KB
実行使用メモリ 334,436 KB
最終ジャッジ日時 2023-10-14 10:20:45
合計ジャッジ時間 52,706 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
76,304 KB
testcase_01 AC 75 ms
76,248 KB
testcase_02 AC 75 ms
76,388 KB
testcase_03 AC 80 ms
76,512 KB
testcase_04 AC 78 ms
76,404 KB
testcase_05 AC 132 ms
80,904 KB
testcase_06 AC 99 ms
79,464 KB
testcase_07 AC 77 ms
76,352 KB
testcase_08 AC 3,588 ms
334,032 KB
testcase_09 AC 3,154 ms
333,984 KB
testcase_10 AC 74 ms
76,532 KB
testcase_11 AC 93 ms
79,224 KB
testcase_12 AC 92 ms
79,048 KB
testcase_13 AC 3,042 ms
333,992 KB
testcase_14 AC 3,200 ms
334,436 KB
testcase_15 AC 4,672 ms
307,176 KB
testcase_16 AC 3,521 ms
334,244 KB
testcase_17 AC 3,379 ms
331,916 KB
testcase_18 AC 121 ms
81,276 KB
testcase_19 AC 2,496 ms
280,588 KB
testcase_20 AC 164 ms
84,212 KB
testcase_21 AC 4,620 ms
305,064 KB
testcase_22 AC 1,506 ms
166,228 KB
testcase_23 AC 4,405 ms
304,700 KB
testcase_24 AC 474 ms
100,160 KB
testcase_25 TLE -
testcase_26 AC 460 ms
99,484 KB
testcase_27 TLE -
testcase_28 AC 2,795 ms
333,444 KB
testcase_29 AC 2,943 ms
328,760 KB
testcase_30 AC 77 ms
76,488 KB
testcase_31 AC 98 ms
79,324 KB
testcase_32 AC 105 ms
79,392 KB
testcase_33 AC 96 ms
79,164 KB
testcase_34 AC 111 ms
79,604 KB
testcase_35 AC 76 ms
76,644 KB
testcase_36 AC 107 ms
79,392 KB
testcase_37 AC 76 ms
76,524 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

dxy = zip([1, 0, -1, 0], [0, 1, 0, -1])
H, W = map(int, raw_input().split())
A, Sy, Sx = map(int, raw_input().split())
B, Gy, Gx = map(int, raw_input().split())
M = [raw_input() for i in xrange(H)]

que = [(A, Sx, Sy)]
used = set()

while que:
    a, x, y = que.pop(0)
    if (a, x, y) in used: continue
    used.add((a, x, y))
    if Gx == x and Gy == y and a == B:
        print "Yes"
        break
    for dx, dy in dxy:
        nx, ny = x + dx, y + dy
        if 0 <= nx < W and 0 <= ny < H:
            na = a + (1 if M[ny][nx] == "*" else -1)
            if na <= 0 or na >= 1100: continue
            if (na, nx, ny) in used: continue
            que.append((na, nx, ny))
else:
    print "No"
0