結果

問題 No.1744 Selfish Spies 1 (à la Princess' Perfectionism)
ユーザー maguroflymagurofly
提出日時 2021-11-14 22:00:01
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 1,159 bytes
コンパイル時間 4,128 ms
コンパイル使用メモリ 269,912 KB
実行使用メモリ 12,492 KB
最終ジャッジ日時 2024-05-07 14:09:36
合計ジャッジ時間 15,991 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 1 ms
6,944 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 1 ms
6,944 KB
testcase_07 AC 1 ms
6,940 KB
testcase_08 AC 1 ms
6,940 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 RE -
testcase_11 AC 11 ms
6,940 KB
testcase_12 AC 27 ms
6,940 KB
testcase_13 RE -
testcase_14 AC 215 ms
6,944 KB
testcase_15 RE -
testcase_16 AC 434 ms
6,944 KB
testcase_17 AC 1,836 ms
6,940 KB
testcase_18 AC 1,748 ms
6,940 KB
testcase_19 AC 4 ms
6,944 KB
testcase_20 RE -
testcase_21 AC 105 ms
6,940 KB
testcase_22 AC 28 ms
6,944 KB
testcase_23 RE -
testcase_24 TLE -
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 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

// ACL
using ll = int;
#include <atcoder/all>
using namespace atcoder;
int main() {
    int N, M, L;
    cin >> N >> M >> L;
    vector<pair<ll, ll>> pairs(L);
    for (int i = 0; i < L; i++) {
        int S, T;
        cin >> S >> T;
        pairs[i] = {S-1, T-1};
    }
    
        mf_graph<int> g1(N * 2 + 2);
        int s = N * 2, t = N * 2 + 1;
        for (int j = 0; j < L; j++) {
            g1.add_edge(pairs[j].first, pairs[j].second + N, 1);
        }
        for (int j = 0; j < N; j++) {
            g1.add_edge(s, j, 1);
            g1.add_edge(j + N, t, 1);
        }
        int maxflow = g1.flow(s, t);
        
    for (int i = 0; i < L; i++) {
        mf_graph<int> g(N * 2 + 2);
        int s = N * 2, t = N * 2 + 1;
        for (int j = 0; j < L; j++) {
            if (j == i) continue;
            g.add_edge(pairs[j].first, pairs[j].second + N, 1);
        }
        for (int j = 0; j < N; j++) {
            g.add_edge(s, j, 1);
            g.add_edge(j + N, t, 1);
        }
        int flow = g.flow(s, t);
        
        cout << ((flow == maxflow) ? "Yes" : "No") << "\n";
    }
}
0