結果
| 問題 |
No.1610 She Loves Me, She Loves Me Not, ...
|
| コンテスト | |
| ユーザー |
t9unkubj
|
| 提出日時 | 2025-02-11 16:34:00 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,673 bytes |
| コンパイル時間 | 4,228 ms |
| コンパイル使用メモリ | 300,160 KB |
| 実行使用メモリ | 101,248 KB |
| 最終ジャッジ日時 | 2025-02-11 16:34:15 |
| 合計ジャッジ時間 | 5,709 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 22 WA * 10 |
ソースコード
#ifdef t9unkubj
#include"debug.cpp"
//#include"template_no_debug.h"
#else
#define dbg(...) 199958
#endif
#undef _GLIBCXX_DEBUG
#pragma GCC optimize("O3")
using namespace std;
#include<bits/stdc++.h>
using ll=long long;
using ull=unsigned long long;
template<class T>using vc=vector<T>;
template<class T>using vvc=vc<vc<T>>;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define REP(i,j,n) for(ll i=(j);i<(ll)(n);i++)
#define DREP(i,n,m) for(ll i=(n);i>=(m);i--)
#define drep(i,n) for(ll i=((n)-1);i>=0;i--)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
template<class T,class F>
bool chmin(T &x, F y){
if(x>y){
x=y;
return true;
}
return false;
}
template<class T, class F>
bool chmax(T &x, F y){
if(x<y){
x=y;
return true;
}
return false;
}
double pass_time=0;
void solve(){
int n,m;
cin>>n>>m;
vc<int>deg(n);
vvc<int>has(n,vc<int>(n));
rep(i,m){
int a,b;
cin>>a>>b;
has[--a][--b]=1;
has[b][a]=1;
deg[a]++;
deg[b]++;
}
int wait=-1;
rep(i,n)if(deg[i]==1)wait=i;
for(int c=0;;c++){
if(wait==-1){
cout<<(c%2?"Yes\n":"No\n");
return;
}
int wait2=-1;
deg[wait]=0;
rep(i,n){
if(has[i][wait]){
has[i][wait]=0;
deg[i]--;
if(deg[i]==1)wait2=i;
}
}
wait=move(wait2);
}
}
signed main(){
cin.tie(0)->sync_with_stdio(0);
pass_time=clock();
int t=1;
//cin>>t;
while(t--)solve();
pass_time=clock()-pass_time;
dbg(pass_time/CLOCKS_PER_SEC);
}
t9unkubj