結果
問題 | No.2387 Yokan Factory |
ユーザー | miho-4 |
提出日時 | 2023-07-21 23:50:28 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 593 bytes |
コンパイル時間 | 523 ms |
コンパイル使用メモリ | 81,592 KB |
実行使用メモリ | 142,732 KB |
最終ジャッジ日時 | 2023-10-21 23:49:29 |
合計ジャッジ時間 | 10,797 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 41 ms
53,440 KB |
testcase_01 | AC | 36 ms
53,440 KB |
testcase_02 | AC | 35 ms
53,440 KB |
testcase_03 | AC | 36 ms
53,440 KB |
testcase_04 | AC | 36 ms
53,440 KB |
testcase_05 | AC | 35 ms
53,440 KB |
testcase_06 | AC | 36 ms
53,440 KB |
testcase_07 | AC | 37 ms
53,440 KB |
testcase_08 | AC | 36 ms
53,440 KB |
testcase_09 | AC | 36 ms
53,440 KB |
testcase_10 | AC | 37 ms
53,440 KB |
testcase_11 | AC | 36 ms
53,440 KB |
testcase_12 | AC | 36 ms
53,440 KB |
testcase_13 | AC | 36 ms
53,440 KB |
testcase_14 | AC | 36 ms
53,440 KB |
testcase_15 | AC | 1,067 ms
142,732 KB |
testcase_16 | AC | 493 ms
130,040 KB |
testcase_17 | TLE | - |
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 | -- | - |
ソースコード
import heapq n,m,X=map(int,input().split()) edge=[list(map(int,input().split())) for _ in range(m)] E=[[] for _ in range(n+1)] for u,v,a,b in edge: E[u].append((v,a,b)) E[v].append((u,a,b)) def f(y): D=[10**19]*(n+1) D[1]=0 q=[] heapq.heappush(q,(0,1)) while q: d,x=heapq.heappop(q) for e,a,b in E[x]: if y<=b and D[x]+a<D[e] and D[x]+a<=X: D[e]=D[x]+a heapq.heappush(q,(d+a,e)) if e==n and D[e]<=X:return True return 0<D[-1]<=X l,r=-1,10**9+10 while l+1<r: m=(l+r)//2 flag=f(m) if flag: l=m else: r=m print(l)