結果

問題 No.1615 Double Down
ユーザー monnumonnu
提出日時 2021-07-21 23:47:03
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 652 bytes
コンパイル時間 4,516 ms
コンパイル使用メモリ 244,980 KB
実行使用メモリ 15,920 KB
最終ジャッジ日時 2023-09-24 19:59:42
合計ジャッジ時間 61,057 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4,502 ms
12,384 KB
testcase_01 AC 4,496 ms
12,224 KB
testcase_02 TLE -
testcase_03 TLE -
testcase_04 AC 4,515 ms
14,992 KB
testcase_05 AC 4,496 ms
14,008 KB
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
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 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using ll=long long;
using Graph=vector<vector<pair<int,int>>>;
#define MAX 100
#define MOD 1000000007
#define INF 1000000000

int main(){
  int N,M,K,L;
  cin>>N>>M>>K>>L;
  mcf_graph<int,ll> G(N+M+2);
  for(int i=0;i<L;i++){
    int X,Y,Z;
    cin>>X>>Y>>Z;
    G.add_edge(X,N+Y,1,(1LL<<32)-(1LL<<Z));
  }
  for(int i=0;i<N;i++){
    G.add_edge(0,i+1,1,0);
    G.add_edge(i+1,N+M+1,1,(1LL<<32));
  }
  for(int i=0;i<M;i++){
    G.add_edge(N+i+1,N+M+1,1,0);
  }
  pair<int,ll> p=G.flow(0,N+M+1);
  ll ans=(ll)p.first*(1LL<<32)-p.second;
  cout<<ans<<endl;
}
0