結果

問題 No.1465 Archaea
ユーザー 👑 KazunKazun
提出日時 2021-04-02 21:37:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 229 bytes
コンパイル時間 254 ms
コンパイル使用メモリ 86,772 KB
実行使用メモリ 79,420 KB
最終ジャッジ日時 2023-08-25 16:10:44
合計ジャッジ時間 2,905 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,224 KB
testcase_01 AC 64 ms
71,204 KB
testcase_02 AC 63 ms
71,236 KB
testcase_03 AC 64 ms
71,192 KB
testcase_04 AC 62 ms
71,052 KB
testcase_05 AC 64 ms
71,112 KB
testcase_06 AC 68 ms
71,228 KB
testcase_07 AC 81 ms
76,924 KB
testcase_08 AC 70 ms
71,112 KB
testcase_09 AC 75 ms
77,124 KB
testcase_10 AC 60 ms
70,964 KB
testcase_11 AC 71 ms
77,052 KB
testcase_12 AC 68 ms
75,968 KB
testcase_13 AC 75 ms
78,452 KB
testcase_14 AC 73 ms
76,976 KB
testcase_15 AC 66 ms
76,048 KB
testcase_16 AC 70 ms
76,212 KB
testcase_17 AC 77 ms
78,580 KB
testcase_18 AC 71 ms
76,056 KB
testcase_19 AC 76 ms
77,064 KB
testcase_20 AC 76 ms
78,216 KB
testcase_21 AC 77 ms
79,208 KB
testcase_22 AC 76 ms
79,420 KB
testcase_23 AC 65 ms
71,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())

inf=float("inf")
DP=[inf]*(N+1)
DP[1]=0

for a in range(2,N+1):
    if a>=3:
        DP[a]=min(DP[a],DP[a-3]+1)

    if a%2==0:
        DP[a]=min(DP[a],DP[a//2]+1)

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