結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,956 KB
testcase_01 AC 15 ms
7,844 KB
testcase_02 AC 15 ms
7,840 KB
testcase_03 AC 14 ms
7,804 KB
testcase_04 AC 15 ms
7,860 KB
testcase_05 WA -
testcase_06 AC 15 ms
7,940 KB
testcase_07 AC 51 ms
8,408 KB
testcase_08 AC 15 ms
7,856 KB
testcase_09 AC 63 ms
8,468 KB
testcase_10 AC 13 ms
7,832 KB
testcase_11 AC 53 ms
8,676 KB
testcase_12 AC 16 ms
7,960 KB
testcase_13 AC 114 ms
9,136 KB
testcase_14 AC 57 ms
8,540 KB
testcase_15 AC 14 ms
7,776 KB
testcase_16 AC 14 ms
7,852 KB
testcase_17 AC 122 ms
9,376 KB
testcase_18 AC 20 ms
8,232 KB
testcase_19 AC 61 ms
8,476 KB
testcase_20 AC 92 ms
8,768 KB
testcase_21 AC 145 ms
9,692 KB
testcase_22 AC 154 ms
9,700 KB
testcase_23 AC 14 ms
7,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

dp = [inf] * (N + 1)
dp[1] = 0
for i in range(3, 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