結果
問題 |
No.2202 贅沢てりたまチキン
|
ユーザー |
|
提出日時 | 2023-02-04 00:19:17 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 154 ms / 2,000 ms |
コード長 | 392 bytes |
コンパイル時間 | 2,022 ms |
コンパイル使用メモリ | 200,980 KB |
最終ジャッジ日時 | 2025-02-10 10:14:59 |
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
ソースコード
#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; }