結果
問題 |
No.2604 Initial Motion
|
ユーザー |
![]() |
提出日時 | 2024-01-12 22:07:05 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 627 bytes |
コンパイル時間 | 4,889 ms |
コンパイル使用メモリ | 265,032 KB |
最終ジャッジ日時 | 2025-02-18 18:20:49 |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 31 RE * 8 |
ソースコード
#include <stdio.h> #include <bits/stdc++.h> #include <atcoder/all> using namespace atcoder; using mint = modint998244353; using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 1000000000000000001 int main(){ int K,N,M; cin>>K>>N>>M; mcf_graph<long long,long long> G(N+2); int S = N; int T = N+1; rep(i,K){ int a; cin>>a; a--; G.add_edge(S,a,1,0); } rep(i,N){ int a; cin>>a; G.add_edge(i,T,a,0); } rep(i,M){ int a,b,c; cin>>a>>b>>c; a--,b--; G.add_edge(a,b,K,c); G.add_edge(b,a,K,c); } cout<<G.flow(S,T,K).second<<endl; return 0; }