結果

問題 No.1465 Archaea
ユーザー NatsubiSoganNatsubiSogan
提出日時 2021-07-17 12:31:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 392 bytes
コンパイル時間 325 ms
コンパイル使用メモリ 10,876 KB
実行使用メモリ 58,760 KB
最終ジャッジ日時 2023-09-21 05:46:41
合計ジャッジ時間 4,003 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,528 KB
testcase_01 AC 18 ms
8,432 KB
testcase_02 AC 20 ms
8,648 KB
testcase_03 AC 18 ms
8,488 KB
testcase_04 RE -
testcase_05 RE -
testcase_06 AC 19 ms
8,420 KB
testcase_07 AC 90 ms
20,704 KB
testcase_08 AC 19 ms
8,500 KB
testcase_09 AC 138 ms
27,212 KB
testcase_10 AC 18 ms
8,420 KB
testcase_11 AC 115 ms
24,044 KB
testcase_12 AC 21 ms
8,844 KB
testcase_13 AC 291 ms
46,620 KB
testcase_14 AC 116 ms
24,852 KB
testcase_15 AC 21 ms
8,884 KB
testcase_16 AC 21 ms
9,052 KB
testcase_17 AC 306 ms
48,508 KB
testcase_18 AC 33 ms
11,120 KB
testcase_19 AC 130 ms
26,152 KB
testcase_20 AC 220 ms
37,892 KB
testcase_21 AC 397 ms
58,760 KB
testcase_22 AC 405 ms
58,744 KB
testcase_23 AC 18 ms
8,412 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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")
0