結果

問題 No.2674 k-Walk on Bipartite
ユーザー t9unkubjt9unkubj
提出日時 2024-03-15 23:07:41
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 908 bytes
コンパイル時間 2,416 ms
コンパイル使用メモリ 209,592 KB
実行使用メモリ 13,688 KB
最終ジャッジ日時 2024-03-15 23:07:47
合計ジャッジ時間 5,202 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 2 ms
6,676 KB
testcase_07 AC 62 ms
11,940 KB
testcase_08 AC 83 ms
10,112 KB
testcase_09 AC 54 ms
11,848 KB
testcase_10 AC 108 ms
11,520 KB
testcase_11 AC 65 ms
9,984 KB
testcase_12 AC 103 ms
10,240 KB
testcase_13 AC 50 ms
10,796 KB
testcase_14 AC 15 ms
8,192 KB
testcase_15 AC 111 ms
12,316 KB
testcase_16 AC 76 ms
12,448 KB
testcase_17 AC 80 ms
9,728 KB
testcase_18 AC 31 ms
8,576 KB
testcase_19 AC 63 ms
11,364 KB
testcase_20 AC 56 ms
11,604 KB
testcase_21 AC 87 ms
10,624 KB
testcase_22 AC 119 ms
13,688 KB
testcase_23 AC 2 ms
6,676 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 2 ms
6,676 KB
testcase_27 AC 2 ms
6,676 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 2 ms
6,676 KB
testcase_31 AC 2 ms
6,676 KB
testcase_32 AC 2 ms
6,676 KB
testcase_33 AC 2 ms
6,676 KB
testcase_34 AC 2 ms
6,676 KB
testcase_35 AC 2 ms
6,676 KB
testcase_36 AC 2 ms
6,676 KB
testcase_37 AC 2 ms
6,676 KB
testcase_38 AC 2 ms
6,676 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);
	}
	int INF=3e5;
	vector<int>md(n,INF);
	queue<int>que;
	md[s]=0;
	que.push(s);
	while(que.size()){
		auto p=que.front();que.pop();
		for(auto x:g[p]){
			if(md[x]>md[p]+1)md[x]=md[p]+1,que.push(x);
		}
	}
	if(md[t]!=INF){
		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