結果
問題 | No.2387 Yokan Factory |
ユーザー | t98slider |
提出日時 | 2023-07-21 21:35:38 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,332 bytes |
コンパイル時間 | 1,981 ms |
コンパイル使用メモリ | 188,856 KB |
実行使用メモリ | 13,516 KB |
最終ジャッジ日時 | 2023-10-21 21:27:35 |
合計ジャッジ時間 | 9,684 ms |
ジャッジサーバーID (参考情報) |
judge9 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,348 KB |
testcase_01 | AC | 2 ms
4,348 KB |
testcase_02 | AC | 2 ms
4,348 KB |
testcase_03 | AC | 2 ms
4,348 KB |
testcase_04 | AC | 2 ms
4,348 KB |
testcase_05 | AC | 2 ms
4,348 KB |
testcase_06 | AC | 2 ms
4,348 KB |
testcase_07 | AC | 2 ms
4,348 KB |
testcase_08 | AC | 2 ms
4,348 KB |
testcase_09 | AC | 2 ms
4,348 KB |
testcase_10 | AC | 2 ms
4,348 KB |
testcase_11 | AC | 2 ms
4,348 KB |
testcase_12 | AC | 2 ms
4,348 KB |
testcase_13 | AC | 2 ms
4,348 KB |
testcase_14 | AC | 2 ms
4,348 KB |
testcase_15 | AC | 308 ms
13,516 KB |
testcase_16 | AC | 183 ms
12,724 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 | -- | - |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(){ ios::sync_with_stdio(false); cin.tie(0); ll n, m, x, ok = -1, ng = 1ll << 30, mid; cin >> n >> m >> x; vector<tuple<ll,ll,ll,ll>> edge(m); for(int i = 0; i < m; i++){ ll a, b, c, d; cin >> a >> b >> c >> d; a--, b--; edge[i] = make_tuple(a, b, c, d); } while(ok + 1 < ng){ mid = (ok + ng) / 2; vector<vector<pair<int, ll>>> g(n); for(int i = 0; i < m; i++){ ll a, b, c, d; tie(a, b, c, d) = edge[i]; if(d < mid) continue; g[a].emplace_back(b, c); g[b].emplace_back(a, c); } priority_queue<pair<ll,int>, vector<pair<ll,int>>, greater<pair<ll,int>>> pq; vector<ll> dist(n, 1ll << 60); pq.emplace(0, 0); dist[0] = 0; while(!pq.empty()){ ll d, c; int v, u; tie(d, v) = pq.top(); pq.pop(); if(dist[v] > d) continue; for(auto &&pa : g[v]){ tie(u, c) = pa; if(d + c >= dist[u]) continue; dist[u] = d + c; pq.emplace(d + c, u); } } (dist[n - 1] <= x ? ok : ng) = mid; } cout << ok << '\n'; }