結果

問題 No.2674 k-Walk on Bipartite
ユーザー tour2sttour2st
提出日時 2024-03-15 23:13:30
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 659 bytes
コンパイル時間 933 ms
コンパイル使用メモリ 98,024 KB
実行使用メモリ 16,448 KB
最終ジャッジ日時 2024-03-15 23:13:36
合計ジャッジ時間 4,886 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
8,640 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 166 ms
14,784 KB
testcase_09 WA -
testcase_10 AC 193 ms
15,936 KB
testcase_11 WA -
testcase_12 AC 195 ms
15,808 KB
testcase_13 WA -
testcase_14 AC 21 ms
9,664 KB
testcase_15 WA -
testcase_16 AC 134 ms
13,888 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 94 ms
12,736 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 4 ms
8,640 KB
testcase_33 AC 4 ms
8,640 KB
testcase_34 WA -
testcase_35 AC 4 ms
8,640 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 AC 4 ms
8,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0