結果

問題 No.2202 贅沢てりたまチキン
ユーザー cho435cho435
提出日時 2023-02-04 00:19:17
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 392 bytes
コンパイル時間 2,207 ms
コンパイル使用メモリ 205,256 KB
実行使用メモリ 4,744 KB
最終ジャッジ日時 2023-09-15 20:36:54
合計ジャッジ時間 6,907 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 4 ms
4,700 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 114 ms
4,692 KB
testcase_15 AC 113 ms
4,624 KB
testcase_16 AC 88 ms
4,700 KB
testcase_17 AC 89 ms
4,700 KB
testcase_18 AC 43 ms
4,380 KB
testcase_19 AC 58 ms
4,712 KB
testcase_20 AC 115 ms
4,688 KB
testcase_21 AC 115 ms
4,608 KB
testcase_22 AC 78 ms
4,380 KB
testcase_23 AC 92 ms
4,376 KB
testcase_24 AC 85 ms
4,376 KB
testcase_25 AC 131 ms
4,744 KB
testcase_26 AC 114 ms
4,588 KB
testcase_27 AC 112 ms
4,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/dsu>
using namespace std;
using ll = long long;
#define rep(i,n) for (int i=0;i<(int)(n);i++)

int main(){
  int n,m;
  cin>>n>>m;
  atcoder::dsu uf(2*n);
  rep(i,m){
    int a,b;
    cin>>a>>b;
    a--; b--;
    uf.merge(a,b+n);
    uf.merge(a+n,b);
  }
  int flg=1;
  rep(i,n){
    if(!uf.same(i,i+n)) flg=0;
  }
  cout<<(flg?"Yes":"No")<<endl;
}
0