結果

問題 No.2387 Yokan Factory
ユーザー ニックネームニックネーム
提出日時 2023-07-21 21:41:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 2,797 ms / 5,000 ms
コード長 573 bytes
コンパイル時間 222 ms
コンパイル使用メモリ 81,784 KB
実行使用メモリ 188,380 KB
最終ジャッジ日時 2023-10-21 21:38:39
合計ジャッジ時間 24,495 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,452 KB
testcase_01 AC 38 ms
53,452 KB
testcase_02 AC 36 ms
53,452 KB
testcase_03 AC 35 ms
53,452 KB
testcase_04 AC 36 ms
53,452 KB
testcase_05 AC 37 ms
53,452 KB
testcase_06 AC 37 ms
53,452 KB
testcase_07 AC 36 ms
53,452 KB
testcase_08 AC 36 ms
53,452 KB
testcase_09 AC 37 ms
53,452 KB
testcase_10 AC 37 ms
53,452 KB
testcase_11 AC 37 ms
53,452 KB
testcase_12 AC 36 ms
53,452 KB
testcase_13 AC 37 ms
53,452 KB
testcase_14 AC 35 ms
53,452 KB
testcase_15 AC 1,026 ms
132,828 KB
testcase_16 AC 564 ms
126,788 KB
testcase_17 AC 1,402 ms
188,380 KB
testcase_18 AC 2,001 ms
137,868 KB
testcase_19 AC 1,771 ms
121,344 KB
testcase_20 AC 1,397 ms
112,676 KB
testcase_21 AC 2,797 ms
145,440 KB
testcase_22 AC 1,317 ms
109,988 KB
testcase_23 AC 1,931 ms
125,088 KB
testcase_24 AC 772 ms
103,532 KB
testcase_25 AC 1,186 ms
104,796 KB
testcase_26 AC 2,137 ms
134,180 KB
testcase_27 AC 2,546 ms
147,188 KB
testcase_28 AC 110 ms
77,304 KB
testcase_29 AC 145 ms
77,948 KB
testcase_30 AC 127 ms
78,016 KB
testcase_31 AC 122 ms
76,748 KB
testcase_32 AC 96 ms
76,244 KB
testcase_33 AC 88 ms
76,220 KB
testcase_34 AC 133 ms
77,652 KB
testcase_35 AC 112 ms
76,844 KB
testcase_36 AC 78 ms
76,228 KB
testcase_37 AC 37 ms
53,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import heappop,heappush
n,m,x = map(int,input().split())
adj = [[] for _ in range(n)]
for _ in range(m):
    u,v,a,b = map(int,input().split())
    adj[u-1].append((v-1,a,b))
    adj[v-1].append((u-1,a,b))
ok = -1; ng = 10**9+1
while ng-ok>1:
    mid = (ok+ng)//2
    t = [0]+[10**18+1]*(n-1); f = [False]*n; hq = [(0,0)]
    while hq:
        d,p = heappop(hq)
        if f[p]: continue
        f[p] = True
        for c,a,b in adj[p]:
            if b>=mid and t[c]>d+a: t[c] = d+a; heappush(hq,(t[c],c))
    if t[n-1]<=x: ok = mid
    else: ng = mid
print(ok)
0