結果
| 問題 |
No.3291 K-step Navigation
|
| コンテスト | |
| ユーザー |
Kyutatsu
|
| 提出日時 | 2025-10-03 22:50:04 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 706 bytes |
| コンパイル時間 | 5,622 ms |
| コンパイル使用メモリ | 334,844 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2025-10-03 22:50:12 |
| 合計ジャッジ時間 | 7,541 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 41 WA * 9 |
ソースコード
#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using ll = long long;
int main() {
// s-t みたいな時、Kが奇数なら行き来するだけでいい??
// K=2nかつs, t が孤立してる時だけ無理?
ll N, M, K, s, t; cin >> N >> M >> K >> s >> t;
vector<int> U(M), V(M);
unordered_set<int> ss, ts;
for (int i=0;i<M;i++) {
cin >> U[i] >> V[i];
if (U[i]==s) ss.insert(V[i]);
if (V[i]==s) ss.insert(U[i]);
if (U[i]==t) ts.insert(V[i]);
if (V[i]==t) ts.insert(U[i]);
}
if (K%2L==0L && ss.empty() && ts.empty()) {
cout << "No" << endl;
}
else {
cout << "Yes" << endl;
}
}
Kyutatsu