結果

問題 No.1465 Archaea
ユーザー tktk_snsntktk_snsn
提出日時 2021-04-02 23:21:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 150 ms / 2,000 ms
コード長 256 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 10,584 KB
実行使用メモリ 9,604 KB
最終ジャッジ日時 2023-08-25 16:20:36
合計ジャッジ時間 2,099 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
7,788 KB
testcase_01 AC 13 ms
7,844 KB
testcase_02 AC 14 ms
7,820 KB
testcase_03 AC 13 ms
7,900 KB
testcase_04 AC 13 ms
7,796 KB
testcase_05 AC 12 ms
7,792 KB
testcase_06 AC 13 ms
7,800 KB
testcase_07 AC 45 ms
8,376 KB
testcase_08 AC 13 ms
7,900 KB
testcase_09 AC 61 ms
8,644 KB
testcase_10 AC 12 ms
7,804 KB
testcase_11 AC 55 ms
8,456 KB
testcase_12 AC 13 ms
7,896 KB
testcase_13 AC 112 ms
9,068 KB
testcase_14 AC 54 ms
8,452 KB
testcase_15 AC 14 ms
7,816 KB
testcase_16 AC 14 ms
7,784 KB
testcase_17 AC 117 ms
9,260 KB
testcase_18 AC 20 ms
8,152 KB
testcase_19 AC 61 ms
8,456 KB
testcase_20 AC 96 ms
8,776 KB
testcase_21 AC 143 ms
9,564 KB
testcase_22 AC 150 ms
9,604 KB
testcase_23 AC 14 ms
7,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

inf = 10**18
N, K = map(int, input().split())

dp = [inf] * (N + 1)
dp[1] = 0
for i in range(2, N + 1):
    dp[i] = min(dp[i], dp[i - 3] + 1)
    if i % 2 == 0:
        dp[i] = min(dp[i], dp[i//2] + 1)

if dp[N] <= K:
    print("YES")
else:
    print("NO")
0