結果

問題 No.2674 k-Walk on Bipartite
ユーザー t9unkubjt9unkubj
提出日時 2024-03-15 23:00:40
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 862 bytes
コンパイル時間 2,398 ms
コンパイル使用メモリ 207,024 KB
実行使用メモリ 14,968 KB
最終ジャッジ日時 2024-03-15 23:00:46
合計ジャッジ時間 5,235 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,548 KB
testcase_01 AC 2 ms
6,548 KB
testcase_02 AC 2 ms
6,548 KB
testcase_03 AC 2 ms
6,548 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 2 ms
6,548 KB
testcase_07 AC 62 ms
12,068 KB
testcase_08 AC 97 ms
11,392 KB
testcase_09 AC 53 ms
11,976 KB
testcase_10 AC 110 ms
13,056 KB
testcase_11 AC 68 ms
10,624 KB
testcase_12 AC 106 ms
12,032 KB
testcase_13 AC 49 ms
10,924 KB
testcase_14 AC 16 ms
8,320 KB
testcase_15 AC 122 ms
13,980 KB
testcase_16 AC 78 ms
12,832 KB
testcase_17 AC 81 ms
11,008 KB
testcase_18 AC 29 ms
8,704 KB
testcase_19 AC 72 ms
11,492 KB
testcase_20 AC 54 ms
11,732 KB
testcase_21 AC 93 ms
11,776 KB
testcase_22 AC 133 ms
14,968 KB
testcase_23 AC 2 ms
6,548 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 2 ms
6,548 KB
testcase_27 AC 2 ms
6,548 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 2 ms
6,548 KB
testcase_31 AC 2 ms
6,548 KB
testcase_32 AC 2 ms
6,548 KB
testcase_33 AC 2 ms
6,548 KB
testcase_34 AC 2 ms
6,548 KB
testcase_35 AC 2 ms
6,548 KB
testcase_36 AC 2 ms
6,548 KB
testcase_37 AC 3 ms
6,548 KB
testcase_38 AC 2 ms
6,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/**
 * author:	t9unkubj
 * created:	2024-03-15 
 */

#include<bits/stdc++.h>

#ifdef t9unkubj
#define _GLIBCXX_DEBUG
#define dbg(x) cout<<__LINE__<<" "<<#x<<":="<<x<<endl;
#else 
#define dbg(x) 58
#endif

using namespace std;

//#include<atcoder/all>
//using namespace atcoder;
int main(){
	ios::sync_with_stdio(false);
	std::cin.tie(nullptr);
	int n,m;
	cin>>n>>m;
	int s,t,k;
	cin>>s>>t>>k;
	s--,t--;
	vector<vector<int>>g(n);
	for(int i=0;i<m;i++){
		int a,b;
		cin>>a>>b;
		a--,b--;
		g[a].push_back(b);
		g[b].push_back(a);
	}
	vector<int>md(n,-1);
	auto dfs=[&](auto&dfs,int now)->void{
		for(auto x:g[now]){
			if(md[x]==-1)md[x]=md[now]+1,dfs(dfs,x);
		}
	};
	md[s]=0;
	dfs(dfs,s);
	if(md[t]!=-1){
		if(md[t]%2!=k%2){
			cout<<"No"<<endl;
		}
		else if(md[t]<=k){
			cout<<"Yes"<<endl;
		}
		else cout<<"Unknown"<<endl;
	}
	else cout<<"Unknown"<<endl;
}
0