結果

問題 No.1465 Archaea
ユーザー NatsubiSoganNatsubiSogan
提出日時 2021-07-17 12:31:57
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 402 ms / 2,000 ms
コード長 396 bytes
コンパイル時間 86 ms
コンパイル使用メモリ 10,732 KB
実行使用メモリ 58,760 KB
最終ジャッジ日時 2023-09-21 05:47:10
合計ジャッジ時間 3,613 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
8,472 KB
testcase_01 AC 18 ms
8,496 KB
testcase_02 AC 19 ms
8,636 KB
testcase_03 AC 20 ms
8,596 KB
testcase_04 AC 19 ms
8,512 KB
testcase_05 AC 19 ms
8,492 KB
testcase_06 AC 19 ms
8,592 KB
testcase_07 AC 92 ms
20,708 KB
testcase_08 AC 19 ms
8,564 KB
testcase_09 AC 134 ms
27,072 KB
testcase_10 AC 19 ms
8,556 KB
testcase_11 AC 114 ms
24,072 KB
testcase_12 AC 21 ms
8,832 KB
testcase_13 AC 298 ms
46,708 KB
testcase_14 AC 122 ms
25,024 KB
testcase_15 AC 21 ms
8,756 KB
testcase_16 AC 21 ms
9,048 KB
testcase_17 AC 307 ms
48,492 KB
testcase_18 AC 33 ms
11,124 KB
testcase_19 AC 128 ms
26,232 KB
testcase_20 AC 214 ms
38,140 KB
testcase_21 AC 393 ms
58,760 KB
testcase_22 AC 402 ms
58,716 KB
testcase_23 AC 19 ms
8,480 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque


n, k = map(int, input().split())
G = [[] for i in range(2 * n + 100)]
for i in range(1, n + 1):
    G[i].append(2 * i)
    G[i].append(i + 3)
d = [-1] * (2 * n + 100)
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")
0