結果
| 問題 | 
                            No.2202 贅沢てりたまチキン
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2023-02-03 22:03:06 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 597 bytes | 
| コンパイル時間 | 2,785 ms | 
| コンパイル使用メモリ | 163,012 KB | 
| 最終ジャッジ日時 | 2025-02-10 09:15:58 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 25 WA * 3 | 
ソースコード
#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;
}