結果

問題 No.2202 贅沢てりたまチキン
コンテスト
ユーザー zezero
提出日時 2023-02-03 22:03:06
言語 C++17
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 597 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,785 ms
コンパイル使用メモリ 163,012 KB
最終ジャッジ日時 2025-02-10 09:15:58
ジャッジサーバーID
(参考情報)
judge5 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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