結果
| 問題 | No.2202 贅沢てりたまチキン |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-09-02 08:28:49 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 80 ms / 2,000 ms |
| + 599µs | |
| コード長 | 366 bytes |
| 記録 | |
| コンパイル時間 | 1,034 ms |
| コンパイル使用メモリ | 170,504 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-25 13:34:12 |
| 合計ジャッジ時間 | 3,812 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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";
}