結果

問題 No.1465 Archaea
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2021-04-02 21:38:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 88 ms / 2,000 ms
コード長 313 bytes
コンパイル時間 322 ms
コンパイル使用メモリ 86,908 KB
実行使用メモリ 79,436 KB
最終ジャッジ日時 2023-08-25 16:10:51
合計ジャッジ時間 3,023 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,360 KB
testcase_01 AC 69 ms
71,408 KB
testcase_02 AC 63 ms
71,540 KB
testcase_03 AC 67 ms
71,232 KB
testcase_04 AC 65 ms
71,212 KB
testcase_05 AC 65 ms
70,988 KB
testcase_06 AC 63 ms
71,068 KB
testcase_07 AC 79 ms
76,904 KB
testcase_08 AC 66 ms
71,316 KB
testcase_09 AC 82 ms
77,232 KB
testcase_10 AC 63 ms
71,360 KB
testcase_11 AC 80 ms
77,164 KB
testcase_12 AC 74 ms
76,028 KB
testcase_13 AC 88 ms
78,628 KB
testcase_14 AC 85 ms
77,048 KB
testcase_15 AC 71 ms
76,116 KB
testcase_16 AC 73 ms
76,028 KB
testcase_17 AC 85 ms
78,608 KB
testcase_18 AC 79 ms
76,336 KB
testcase_19 AC 78 ms
77,504 KB
testcase_20 AC 81 ms
78,156 KB
testcase_21 AC 85 ms
79,436 KB
testcase_22 AC 80 ms
79,312 KB
testcase_23 AC 61 ms
71,228 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from sys import stdin
import math

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

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

for i in range(1,N):

    if 2*i <= N:
        dp[2*i] = min(dp[2*i] , dp[i]+1)
    if i+3 <= N:
        dp[i+3] = min(dp[i+3] , dp[i]+1)

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