結果
問題 | No.2387 Yokan Factory |
ユーザー | mymelochan |
提出日時 | 2023-07-21 21:36:00 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 3,084 ms / 5,000 ms |
コード長 | 1,188 bytes |
コンパイル時間 | 1,361 ms |
コンパイル使用メモリ | 81,616 KB |
実行使用メモリ | 186,528 KB |
最終ジャッジ日時 | 2023-10-21 21:29:23 |
合計ジャッジ時間 | 27,683 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge9 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 45 ms
55,572 KB |
testcase_01 | AC | 45 ms
55,572 KB |
testcase_02 | AC | 45 ms
55,572 KB |
testcase_03 | AC | 47 ms
55,572 KB |
testcase_04 | AC | 45 ms
55,572 KB |
testcase_05 | AC | 45 ms
55,572 KB |
testcase_06 | AC | 47 ms
55,572 KB |
testcase_07 | AC | 46 ms
55,572 KB |
testcase_08 | AC | 47 ms
55,572 KB |
testcase_09 | AC | 47 ms
55,572 KB |
testcase_10 | AC | 45 ms
55,572 KB |
testcase_11 | AC | 45 ms
55,572 KB |
testcase_12 | AC | 46 ms
55,572 KB |
testcase_13 | AC | 46 ms
55,572 KB |
testcase_14 | AC | 45 ms
55,572 KB |
testcase_15 | AC | 1,097 ms
125,372 KB |
testcase_16 | AC | 604 ms
122,076 KB |
testcase_17 | AC | 1,776 ms
186,528 KB |
testcase_18 | AC | 1,471 ms
118,352 KB |
testcase_19 | AC | 2,036 ms
113,128 KB |
testcase_20 | AC | 1,479 ms
104,144 KB |
testcase_21 | AC | 3,023 ms
129,504 KB |
testcase_22 | AC | 1,508 ms
103,304 KB |
testcase_23 | AC | 2,233 ms
116,464 KB |
testcase_24 | AC | 903 ms
99,844 KB |
testcase_25 | AC | 1,347 ms
98,664 KB |
testcase_26 | AC | 2,752 ms
128,160 KB |
testcase_27 | AC | 3,084 ms
136,088 KB |
testcase_28 | AC | 106 ms
77,376 KB |
testcase_29 | AC | 148 ms
78,256 KB |
testcase_30 | AC | 137 ms
77,980 KB |
testcase_31 | AC | 127 ms
77,600 KB |
testcase_32 | AC | 109 ms
76,452 KB |
testcase_33 | AC | 94 ms
76,264 KB |
testcase_34 | AC | 146 ms
78,192 KB |
testcase_35 | AC | 121 ms
76,992 KB |
testcase_36 | AC | 92 ms
76,208 KB |
testcase_37 | AC | 46 ms
55,572 KB |
ソースコード
############################################################# import sys sys.setrecursionlimit(10**7) from heapq import heappop,heappush from collections import deque,defaultdict,Counter from bisect import bisect_left, bisect_right from itertools import product,combinations,permutations ipt = sys.stdin.readline def iin(): return int(ipt()) def lmin(): return list(map(int,ipt().split())) inf = 1<<60 MOD = 998244353 ############################################################# N,M,X = lmin() G = [[] for _ in range(N)] for _ in range(M): u,v,a,b = lmin() u,v = u-1,v-1 G[u].append((v,a,b)) G[v].append((u,a,b)) def check(cen): cost = [inf]*N cost[0] = 0 hq = [] heappush(hq, (0,0)) while hq: t,cur = heappop(hq) if t > cost[cur]: continue for nxt,a,b in G[cur]: if b < cen: continue nt = t+a if nt < cost[nxt]: cost[nxt] = nt heappush(hq, (nt, nxt)) return cost[-1] <= X ok = -1 ng = 1<<30 while ng - ok > 1: cen = (ok+ng)//2 if check(cen): ok = cen else: ng = cen print(ok)