結果

問題 No.2387 Yokan Factory
ユーザー zeronosu77108
提出日時 2023-07-21 22:32:37
言語 C++17(clang)
(17.0.6 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 614 bytes
コンパイル時間 3,110 ms
コンパイル使用メモリ 144,216 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-09-22 00:00:50
合計ジャッジ時間 10,129 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5 WA * 7 TLE * 1 -- * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <queue>
#include <atcoder/all>

using namespace std;
using namespace atcoder;

int main() {
    int n,m,x;
    cin >> n >> m >> x;

	mcf_graph<int, long long> pd(n);

    for (int _=0; _<m; _++) {
        long long u,v,a,b; cin >> u >> v >> a >> b;
        u--; v--;
        pd.add_edge(u,v, b,a);
        pd.add_edge(v,u, b,a);
    }

    auto v = pd.slope(0, n-1);
    long long ans = -1;
    bool f = true;
    for (const auto& [a,b]: v) {
      if (f) { f=false; continue; }
        if (b/2 <= x) ans = max(ans, (long long)a);
    }
  
  cout << ans << endl;
  
}
0