結果
問題 |
No.2202 贅沢てりたまチキン
|
ユーザー |
|
提出日時 | 2023-09-02 08:28:49 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 114 ms / 2,000 ms |
コード長 | 366 bytes |
コンパイル時間 | 844 ms |
コンパイル使用メモリ | 101,032 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-11 15:22:40 |
合計ジャッジ時間 | 3,391 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
ソースコード
#include <iostream> #include <atcoder/dsu> using namespace std; using namespace atcoder; int main() { int n, m; cin >> n >> m; dsu uf(2 * n); while (m--) { int a, b; cin >> a >> b; a--; b--; uf.merge(a, b + n); uf.merge(a + n, b); } for (int i = 0; i < n; i++) { if (!uf.same(i, i + n)) { cout << "No\n"; return 0; } } cout << "Yes\n"; }