結果

問題 No.2910 単体ホモロジー入門
ユーザー t98slidert98slider
提出日時 2024-10-12 04:07:05
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 656 bytes
コンパイル時間 2,245 ms
コンパイル使用メモリ 206,316 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-12 04:07:09
合計ジャッジ時間 3,444 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,248 KB
testcase_02 AC 2 ms
5,248 KB
testcase_03 AC 2 ms
5,248 KB
testcase_04 AC 2 ms
5,248 KB
testcase_05 AC 2 ms
5,248 KB
testcase_06 AC 4 ms
5,248 KB
testcase_07 AC 2 ms
5,248 KB
testcase_08 AC 2 ms
5,248 KB
testcase_09 AC 2 ms
5,248 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 2 ms
5,248 KB
testcase_13 AC 1 ms
5,248 KB
testcase_14 AC 2 ms
5,248 KB
testcase_15 AC 2 ms
5,248 KB
testcase_16 AC 2 ms
5,248 KB
testcase_17 AC 2 ms
5,248 KB
testcase_18 AC 1 ms
5,248 KB
testcase_19 AC 2 ms
5,248 KB
testcase_20 AC 2 ms
5,248 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 2 ms
5,248 KB
testcase_24 AC 2 ms
5,248 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 2 ms
5,248 KB
testcase_28 AC 2 ms
5,248 KB
testcase_29 WA -
testcase_30 AC 1 ms
5,248 KB
testcase_31 AC 2 ms
5,248 KB
testcase_32 WA -
testcase_33 AC 2 ms
5,248 KB
testcase_34 WA -
testcase_35 AC 1 ms
5,248 KB
testcase_36 AC 2 ms
5,248 KB
testcase_37 AC 1 ms
5,248 KB
testcase_38 AC 2 ms
5,248 KB
testcase_39 AC 2 ms
5,248 KB
testcase_40 AC 2 ms
5,248 KB
testcase_41 AC 2 ms
5,248 KB
testcase_42 AC 2 ms
5,248 KB
testcase_43 AC 2 ms
5,248 KB
testcase_44 AC 2 ms
5,248 KB
testcase_45 AC 2 ms
5,248 KB
testcase_46 AC 1 ms
5,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
    int n, m, u, v;
    cin >> n >> m;
    array<array<bool,4>,4> A{};
    for(int i = 0; i < m; i++){
        cin >> u >> v;
        A[u][v] = A[v][u] = 1;
    }
    vector<int> a(3), b = {0, 1, 2, 3};
    for(auto &&v : a) cin >> v;
    sort(a.begin(), a.end());
    auto check = [&](vector<int> c){
        sort(c.begin(), c.end());
        return c != a;
    };
    do{
        if(A[b[0]][b[1]] && A[b[1]][b[2]] && (check({b[0], b[1], b[2]}) || A[b[2]][b[3]])){
            cout << "Yes\n";
            exit(0);
        }
    }while(next_permutation(b.begin(), b.end()));
    cout << "No\n";
}
0