結果
問題 |
No.2910 単体ホモロジー入門
|
ユーザー |
|
提出日時 | 2024-10-12 04:09:44 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 694 bytes |
コンパイル時間 | 2,018 ms |
コンパイル使用メモリ | 199,700 KB |
最終ジャッジ日時 | 2025-02-24 17:24:38 |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 47 |
ソースコード
#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]] && ((A[b[2]][b[0]] && check({b[0], b[1], b[2]})) || (A[b[2]][b[3]] && A[b[3]][b[0]]))){ cout << "Yes\n"; exit(0); } }while(next_permutation(b.begin(), b.end())); cout << "No\n"; }