結果

問題 No.2202 贅沢てりたまチキン
ユーザー hanagehanage
提出日時 2023-12-02 14:22:23
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 456 bytes
コンパイル時間 1,953 ms
コンパイル使用メモリ 174,836 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-12-02 14:22:29
合計ジャッジ時間 6,006 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 AC 2 ms
6,676 KB
testcase_06 AC 2 ms
6,676 KB
testcase_07 AC 2 ms
6,676 KB
testcase_08 AC 1 ms
6,676 KB
testcase_09 AC 2 ms
6,676 KB
testcase_10 AC 4 ms
6,676 KB
testcase_11 AC 1 ms
6,676 KB
testcase_12 AC 2 ms
6,676 KB
testcase_13 AC 2 ms
6,676 KB
testcase_14 AC 122 ms
6,676 KB
testcase_15 AC 122 ms
6,676 KB
testcase_16 AC 96 ms
6,676 KB
testcase_17 AC 95 ms
6,676 KB
testcase_18 AC 47 ms
6,676 KB
testcase_19 AC 63 ms
6,676 KB
testcase_20 AC 124 ms
6,676 KB
testcase_21 AC 125 ms
6,676 KB
testcase_22 AC 85 ms
6,676 KB
testcase_23 AC 101 ms
6,676 KB
testcase_24 AC 95 ms
6,676 KB
testcase_25 AC 132 ms
6,676 KB
testcase_26 AC 122 ms
6,676 KB
testcase_27 AC 122 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <atcoder/dsu>
using namespace atcoder;
int main() {
  int N, M;
  cin >> N >> M;
  dsu Union(2 * N);
  for (int i = 0; i < M; i++) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    Union.merge(a, b + N);
    Union.merge(a + N, b);
  }
  bool ok = true;
  for (int i = 0; i < N; i++) {
    if (!Union.same(i, i + N)) {
      ok = false;
    }
  }
  cout << (ok ? "Yes" : "No") << endl;
  return 0;
}
0