結果
問題 | No.2910 単体ホモロジー入門 |
ユーザー | 👑 p-adic |
提出日時 | 2023-09-08 15:42:51 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,647 bytes |
コンパイル時間 | 2,418 ms |
コンパイル使用メモリ | 209,656 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-26 08:47:53 |
合計ジャッジ時間 | 3,471 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
5,248 KB |
testcase_01 | AC | 2 ms
5,376 KB |
testcase_02 | AC | 2 ms
5,376 KB |
testcase_03 | AC | 2 ms
5,376 KB |
testcase_04 | AC | 2 ms
5,376 KB |
testcase_05 | AC | 2 ms
5,376 KB |
testcase_06 | AC | 2 ms
5,376 KB |
testcase_07 | AC | 2 ms
5,376 KB |
testcase_08 | AC | 2 ms
5,376 KB |
testcase_09 | AC | 2 ms
5,376 KB |
testcase_10 | AC | 2 ms
5,376 KB |
testcase_11 | AC | 2 ms
5,376 KB |
testcase_12 | AC | 2 ms
5,376 KB |
testcase_13 | AC | 2 ms
5,376 KB |
testcase_14 | AC | 2 ms
5,376 KB |
testcase_15 | AC | 2 ms
5,376 KB |
testcase_16 | AC | 2 ms
5,376 KB |
testcase_17 | AC | 2 ms
5,376 KB |
testcase_18 | AC | 2 ms
5,376 KB |
testcase_19 | AC | 2 ms
5,376 KB |
testcase_20 | AC | 2 ms
5,376 KB |
testcase_21 | AC | 2 ms
5,376 KB |
testcase_22 | AC | 2 ms
5,376 KB |
testcase_23 | AC | 2 ms
5,376 KB |
testcase_24 | AC | 2 ms
5,376 KB |
testcase_25 | AC | 2 ms
5,376 KB |
testcase_26 | AC | 2 ms
5,376 KB |
testcase_27 | AC | 2 ms
5,376 KB |
testcase_28 | AC | 2 ms
5,376 KB |
testcase_29 | AC | 2 ms
5,376 KB |
testcase_30 | AC | 2 ms
5,376 KB |
testcase_31 | AC | 2 ms
5,376 KB |
testcase_32 | AC | 2 ms
5,376 KB |
testcase_33 | AC | 2 ms
5,376 KB |
testcase_34 | AC | 2 ms
5,376 KB |
testcase_35 | AC | 2 ms
5,376 KB |
testcase_36 | AC | 2 ms
5,376 KB |
testcase_37 | AC | 2 ms
5,376 KB |
testcase_38 | AC | 2 ms
5,376 KB |
testcase_39 | AC | 2 ms
5,376 KB |
testcase_40 | AC | 2 ms
5,376 KB |
testcase_41 | AC | 2 ms
5,376 KB |
testcase_42 | AC | 2 ms
5,376 KB |
testcase_43 | AC | 2 ms
5,376 KB |
testcase_44 | AC | 2 ms
5,376 KB |
testcase_45 | AC | 2 ms
5,376 KB |
testcase_46 | AC | 2 ms
5,376 KB |
コンパイルメッセージ
main.cpp: In function 'int main()': main.cpp:78:38: warning: 'end0' may be used uninitialized [-Wmaybe-uninitialized] 78 | if( end3 != start0 || end3 == end0 ){ | ~~~~~^~~~~~~ main.cpp:25:11: note: 'end0' was declared here 25 | int end0; | ^~~~ main.cpp:78:20: warning: 'start0' may be used uninitialized [-Wmaybe-uninitialized] 78 | if( end3 != start0 || end3 == end0 ){ | ~~~~~^~~~~~~~~ main.cpp:24:11: note: 'start0' was declared here 24 | int start0; | ^~~~~~
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int M; cin >> M; constexpr int bound_M = 6; int ij[bound_M][2]; for( int m = 0 ; m < M ; m++ ){ cin >> ij[m][0] >> ij[m][1]; } set<int> vertex_exception{}; for( int i = 0 ; i < 3 ; i++ ){ int v; cin >> v; vertex_exception.insert( v ); } for( int m0 = 0 ; m0 < M ; m0++ ){ for( int m1 = 0 ; m1 < M ; m1++ ){ if( m0 == m1 ){ continue; } int count1 = 0; int start0; int end0; int end1; for( int s = 0 ; s < 2 ; s++ ){ for( int t = 0 ; t < 2 ; t++ ){ if( ij[m0][s] == ij[m1][t] ){ count1++; start0 = ij[m0][1-s]; end0 = ij[m0][s]; end1 = ij[m1][1-t]; } } } if( count1 != 1 ){ continue; } for( int m2 = 0 ; m2 < M ; m2++ ){ if( m0 == m2 || m1 == m2 ){ continue; } int count2 = 0; int end2; for( int t = 0 ; t < 2 ; t++ ){ if( end1 == ij[m2][t] ){ count2++; end2 = ij[m2][1-t]; } } if( count2 != 1 ){ continue; } if( end2 == start0 ){ set<int> vertex{ end0 , end1 , end2 }; if( vertex != vertex_exception ){ cout << "Yes\n"; return 0; } continue; } for( int m3 = 0 ; m3 < M ; m3++ ){ if( m0 == m3 || m1 == m3 || m2 == m3 ){ continue; } int count3 = 0; int end3; for( int t = 0 ; t < 2 ; t++ ){ if( end2 == ij[m3][t] ){ count3++; end3 = ij[m3][1-t]; } } if( count3 != 1 ){ continue; } if( end3 != start0 || end3 == end0 ){ continue; } cout << "Yes\n"; return 0; } } } } cout << "No\n"; return 0; }