結果

問題 No.3291 K-step Navigation
ユーザー shingo0909
提出日時 2025-10-03 22:52:40
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 573 bytes
コンパイル時間 3,106 ms
コンパイル使用メモリ 281,084 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2025-10-03 22:52:45
合計ジャッジ時間 4,818 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 41 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <cstdlib>
#include <math.h>
using namespace std;

using ll = long long;


int main(){
    ll n,m,k,s,t;
    cin >> n >> m >> k >> s >> t;
    s--;t--;
    vector<vector<int>>g(n);
    for(int i=0;i<m;i++){
        int u,v;
        cin >> u >> v;
        u--;v--;
        g[u].push_back(v);
        g[v].push_back(u);
    }
    if(k%2){
        cout << "Yes" << endl;
    }else{
        if(g[s].size()==0 && g[t].size()==0){
            cout << "No" << endl;
        }else{
            cout << "Yes" << endl;
        }
    }
    return 0;
}
0