結果
| 問題 | 
                            No.1745 Selfish Spies 2 (à la Princess' Perfectionism)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             cureskol
                         | 
                    
| 提出日時 | 2021-11-14 21:39:28 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 894 bytes | 
| コンパイル時間 | 5,449 ms | 
| コンパイル使用メモリ | 264,848 KB | 
| 実行使用メモリ | 47,844 KB | 
| 最終ジャッジ日時 | 2024-11-30 06:48:37 | 
| 合計ジャッジ時間 | 10,658 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 27 WA * 32 | 
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:27:10: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
   27 |     auto [from,to,cap,flow]=edges[i];
      |          ^
main.cpp:35:10: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
   35 |     auto [from,to,cap,flow]=edges[i];
      |          ^
            
            ソースコード
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=(n-1);i>=0;i--)
#define ALL(v) v.begin(),v.end()
int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n,m,l;cin>>n>>m>>l;
  mf_graph<int> fl(n+m+2);
  int S=n+m,T=n+m+1;
  REP(_,l){
    int s,t;cin>>s>>t;s--;t--;
    fl.add_edge(s,n+t,1);
  }
  REP(i,n)fl.add_edge(S,i,1);
  REP(j,m)fl.add_edge(n+j,T,1);
  fl.flow(S,T);
  scc_graph g(n+m);
  auto edges=fl.edges();
  REP(i,l){
    auto [from,to,cap,flow]=edges[i];
    if(flow)g.add_edge(from,to);
    else g.add_edge(to,from);
  }
  auto A=g.scc();
  dsu uf(n+m);
  for(auto v:A)for(int p:v)uf.merge(v[0],p);
  REP(i,l){
    auto [from,to,cap,flow]=edges[i];
    if(flow||uf.same(from,to))cout<<"Yes\n";
    else cout<<"No\n";
  }
}
            
            
            
        
            
cureskol