結果

問題 No.1465 Archaea
ユーザー AEnAEn
提出日時 2022-06-15 00:40:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 438 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 82,200 KB
実行使用メモリ 74,984 KB
最終ジャッジ日時 2024-04-14 06:29:53
合計ジャッジ時間 2,681 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
54,240 KB
testcase_01 AC 44 ms
55,100 KB
testcase_02 AC 48 ms
54,104 KB
testcase_03 AC 43 ms
54,016 KB
testcase_04 AC 42 ms
54,648 KB
testcase_05 AC 44 ms
54,176 KB
testcase_06 AC 43 ms
54,720 KB
testcase_07 AC 63 ms
67,800 KB
testcase_08 AC 44 ms
54,248 KB
testcase_09 AC 66 ms
70,396 KB
testcase_10 AC 43 ms
54,656 KB
testcase_11 AC 63 ms
67,648 KB
testcase_12 AC 49 ms
60,580 KB
testcase_13 AC 75 ms
73,732 KB
testcase_14 AC 63 ms
68,164 KB
testcase_15 AC 42 ms
54,892 KB
testcase_16 AC 42 ms
54,100 KB
testcase_17 AC 76 ms
74,804 KB
testcase_18 AC 47 ms
60,456 KB
testcase_19 AC 48 ms
55,664 KB
testcase_20 AC 64 ms
69,096 KB
testcase_21 AC 79 ms
74,632 KB
testcase_22 AC 76 ms
74,984 KB
testcase_23 AC 42 ms
53,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque

N, K = map(int, input().split())
is_ok = [False]*(N+1)
is_ok[1] = True
d = deque()
d.append((1, 0))
while d:
    p, cnt = d.popleft()
    if cnt>=K:
        continue
    if p*2<=N and is_ok[p*2]==False:
        is_ok[p*2] = True
        d.append((p*2, cnt+1))
    if p+3<=N and is_ok[p+3]==False:
        is_ok[p+3] = True
        d.append((p+3, cnt+1))
if is_ok[-1]:
    print('YES')
else:
    print('NO')
0