結果

問題 No.2202 贅沢てりたまチキン
ユーザー zezerozezero
提出日時 2023-02-03 22:03:06
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 597 bytes
コンパイル時間 3,138 ms
コンパイル使用メモリ 160,188 KB
実行使用メモリ 29,588 KB
最終ジャッジ日時 2023-09-15 17:53:58
合計ジャッジ時間 5,887 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 WA -
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 41 ms
29,588 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 1 ms
4,384 KB
testcase_14 AC 123 ms
18,896 KB
testcase_15 AC 123 ms
18,768 KB
testcase_16 AC 99 ms
18,672 KB
testcase_17 AC 98 ms
18,764 KB
testcase_18 AC 49 ms
11,208 KB
testcase_19 AC 81 ms
23,428 KB
testcase_20 WA -
testcase_21 AC 132 ms
19,168 KB
testcase_22 AC 78 ms
4,380 KB
testcase_23 AC 94 ms
4,380 KB
testcase_24 AC 85 ms
4,380 KB
testcase_25 AC 144 ms
20,540 KB
testcase_26 WA -
testcase_27 AC 123 ms
18,700 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <map>
#include <set>
#include <queue>
#include <iomanip>
#include <cstring>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < int(n);i++)

int main(){
  int n,m;
  cin >> n >> m;
  dsu d(2*n);
  for (int i = 0; i < m;i++){
    int a,b;
    cin >> a >> b;
    a--;b--;
    d.merge(a,b+n);
    d.merge(a+n,b);
  }
  if (d.groups().size() == 1){
    cout << "Yes\n";
  }
  else cout << "No" << endl;
  
  return 0;
}
0