結果
| 問題 |
No.1744 Selfish Spies 1 (à la Princess' Perfectionism)
|
| コンテスト | |
| ユーザー |
cureskol
|
| 提出日時 | 2021-11-14 21:37:35 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 895 bytes |
| コンパイル時間 | 4,786 ms |
| コンパイル使用メモリ | 263,552 KB |
| 実行使用メモリ | 11,724 KB |
| 最終ジャッジ日時 | 2024-11-30 06:45:39 |
| 合計ジャッジ時間 | 6,558 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 21 WA * 18 |
コンパイルメッセージ
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