結果

問題 No.3291 K-step Navigation
ユーザー GOTKAKO
提出日時 2025-10-03 21:53:58
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 528 bytes
コンパイル時間 1,678 ms
コンパイル使用メモリ 198,252 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2025-10-03 21:54:14
合計ジャッジ時間 3,410 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 41 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    
    long long N,M,K,s,t; cin >> N >> M >> K >> s >> t,s--,t--;
    vector<vector<int>> Graph(N);
    for(int i=0; i<M; i++){
        int u,v; cin >> u >> v;
        u--; v--;
        Graph.at(u).push_back(v);
        Graph.at(v).push_back(u);
    }
    if(K%2){cout << "Yes\n"; return 0;}
    if(Graph.at(s).size() == 0 && Graph.at(t).size() == 0 && K%2 == 0) cout << "No\n";
    else cout << "Yes\n";
}
0