結果
問題 | No.20 砂漠のオアシス |
ユーザー | konchanksu |
提出日時 | 2020-04-30 19:56:30 |
言語 | PyPy3 (7.3.13) |
結果 |
WA
|
実行時間 | - |
コード長 | 774 bytes |
コンパイル時間 | 801 ms |
コンパイル使用メモリ | 87,172 KB |
実行使用メモリ | 269,860 KB |
最終ジャッジ日時 | 2023-08-22 14:29:53 |
合計ジャッジ時間 | 14,496 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 174 ms
80,788 KB |
testcase_01 | AC | 171 ms
80,612 KB |
testcase_02 | AC | 181 ms
82,808 KB |
testcase_03 | AC | 225 ms
83,356 KB |
testcase_04 | AC | 290 ms
84,200 KB |
testcase_05 | AC | 244 ms
84,156 KB |
testcase_06 | AC | 308 ms
85,180 KB |
testcase_07 | WA | - |
testcase_08 | AC | 1,307 ms
109,792 KB |
testcase_09 | AC | 1,552 ms
123,664 KB |
testcase_10 | AC | 170 ms
80,696 KB |
testcase_11 | AC | 171 ms
80,808 KB |
testcase_12 | AC | 233 ms
83,392 KB |
testcase_13 | AC | 301 ms
84,964 KB |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | AC | 370 ms
85,972 KB |
testcase_18 | WA | - |
testcase_19 | AC | 618 ms
92,536 KB |
testcase_20 | WA | - |
ソースコード
import queue N, V, Ox, Oy = map(int, input().split()) Ox -= 1 Oy -= 1 L = [[int(j) for j in input().split()] for i in range(N)] memo = [[0 for i in range(N)] for j in range(N)] memo[0][0] = V course = [(1, 0), (0, 1), (-1, 0), (0, -1)] a = queue.Queue() a.put((0, 0, V)) while a.qsize(): tmp = a.get() for i in course: y, x = tmp[0] + i[0], tmp[1] - i[1] if x < 0 or x >= N or y < 0 or y >= N: continue v = tmp[2] - L[y][x] if v <= memo[y][x]: continue if x == N - 1 and y == N - 1: print('YES') exit() if y == Oy and x == Ox: memo[y][x] = v * 2 else: memo[y][x] = v a.put((y, x, memo[y][x])) print('NO')