結果
| 問題 |
No.1465 Archaea
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-07-17 12:31:22 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 392 bytes |
| コンパイル時間 | 185 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 61,056 KB |
| 最終ジャッジ日時 | 2024-07-07 00:14:58 |
| 合計ジャッジ時間 | 3,659 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 18 RE * 2 |
ソースコード
from collections import deque
n, k = map(int, input().split())
G = [[] for i in range(2 * n + 1)]
for i in range(1, n + 1):
G[i].append(2 * i)
G[i].append(i + 3)
d = [-1] * (2 * n + 1)
d[1] = 0
Q = deque([1])
while Q:
u = Q.popleft()
for v in G[u]:
if d[v] == -1:
d[v] = d[u] + 1
Q.append(v)
print("YES" if d[n] != -1 and d[n] <= k else "NO")