結果
問題 |
No.2674 k-Walk on Bipartite
|
ユーザー |
![]() |
提出日時 | 2024-03-15 23:13:30 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 659 bytes |
コンパイル時間 | 831 ms |
コンパイル使用メモリ | 99,352 KB |
実行使用メモリ | 16,256 KB |
最終ジャッジ日時 | 2024-09-30 02:46:31 |
合計ジャッジ時間 | 4,208 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 10 WA * 26 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <stack> #include <queue> #include <set> #include <map> #include <random> #include <time.h> #include <map> using namespace std; int n,m,s,t,k,a,b; vector<int>e[200000]; int length[200000]; bool visited[200000]; void dfs(int now, int len=0) { if(visited[now]) return; visited[now]=true; length[now]=len; for(int nxt:e[now]) dfs(nxt, len+1); } int main() { cin >> n >> m >> s >> t >> k; for(int i=0;i<m;i++) { cin >> a >> b; a--;b--; e[a].push_back(b); e[b].push_back(a); } s--;t--; dfs(s); cout << "Yes" << endl; }