結果
問題 | No.2387 Yokan Factory |
ユーザー | Akijin_007 |
提出日時 | 2023-07-21 22:03:01 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 706 bytes |
コンパイル時間 | 151 ms |
コンパイル使用メモリ | 81,452 KB |
実行使用メモリ | 53,412 KB |
最終ジャッジ日時 | 2023-10-21 22:05:01 |
合計ジャッジ時間 | 7,984 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge10 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 40 ms
53,412 KB |
testcase_01 | AC | 37 ms
53,316 KB |
testcase_02 | AC | 36 ms
53,316 KB |
testcase_03 | WA | - |
testcase_04 | AC | 40 ms
53,316 KB |
testcase_05 | AC | 36 ms
53,316 KB |
testcase_06 | AC | 36 ms
53,316 KB |
testcase_07 | AC | 37 ms
53,316 KB |
testcase_08 | WA | - |
testcase_09 | AC | 36 ms
53,316 KB |
testcase_10 | AC | 37 ms
53,316 KB |
testcase_11 | AC | 35 ms
53,316 KB |
testcase_12 | AC | 37 ms
53,316 KB |
testcase_13 | AC | 37 ms
53,316 KB |
testcase_14 | AC | 37 ms
53,316 KB |
testcase_15 | TLE | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
testcase_27 | -- | - |
testcase_28 | -- | - |
testcase_29 | -- | - |
testcase_30 | -- | - |
testcase_31 | -- | - |
testcase_32 | -- | - |
testcase_33 | -- | - |
testcase_34 | -- | - |
testcase_35 | -- | - |
testcase_36 | -- | - |
testcase_37 | -- | - |
ソースコード
#int(input()) #map(int, input().split()) #list(map(int, input().split())) N, M, X = map(int, input().split()) to = [[] for i in range(N)] for i in range(M): u, v, a, b = map(int, input().split()) to[u-1].append((v-1, a, b)) to[v-1].append((u-1, a, b)) import heapq ans = -1 v = [-1] * N v[0] = 10 ** 9 q = [(-(10**9), 0, 0)] heapq.heapify(q) c = 1 while q: s, x, t = heapq.heappop(q) s *= -1 # print(s, x, t) if v[x] > s: continue for y, a, b in to[x]: if t + a > X: continue # if v[y] >= min(b, s): # continue heapq.heappush(q, (-min(b, s), y, t+a)) v[y] = max(min(b, s), v[y]) print(min(v)) # print(v)