結果

問題 No.1465 Archaea
ユーザー sgswsgsw
提出日時 2021-05-05 19:48:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 142 ms / 2,000 ms
コード長 573 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 10,868 KB
実行使用メモリ 9,476 KB
最終ジャッジ日時 2023-10-11 13:56:42
合計ジャッジ時間 4,829 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 140 ms
9,348 KB
testcase_01 AC 137 ms
9,368 KB
testcase_02 AC 135 ms
9,296 KB
testcase_03 AC 137 ms
9,336 KB
testcase_04 AC 137 ms
9,424 KB
testcase_05 AC 139 ms
9,432 KB
testcase_06 AC 138 ms
9,372 KB
testcase_07 AC 136 ms
9,372 KB
testcase_08 AC 140 ms
9,432 KB
testcase_09 AC 140 ms
9,332 KB
testcase_10 AC 137 ms
9,464 KB
testcase_11 AC 137 ms
9,352 KB
testcase_12 AC 140 ms
9,348 KB
testcase_13 AC 136 ms
9,348 KB
testcase_14 AC 136 ms
9,348 KB
testcase_15 AC 137 ms
9,336 KB
testcase_16 AC 135 ms
9,452 KB
testcase_17 AC 137 ms
9,404 KB
testcase_18 AC 138 ms
9,364 KB
testcase_19 AC 134 ms
9,348 KB
testcase_20 AC 137 ms
9,444 KB
testcase_21 AC 136 ms
9,372 KB
testcase_22 AC 142 ms
9,476 KB
testcase_23 AC 139 ms
9,336 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

def input():
    return sys.stdin.readline().rstrip()

"""
Do not get stuck on a problem for more than 20 minutes
Just check the editorial :)
There should be something else to do insead
"""
MAXN = 200010
INF = 1 << 128
DP = [INF]*(MAXN)
DP[1] = 0
for i in range(1,MAXN):
    if i % 2 == 0:
        DP[i] = min(DP[i],DP[i//2] + 1,DP[i-3] + 1)
    else:
        DP[i] = min(DP[i],DP[i-3] + 1)

def main():
    n,k = map(int,input().split())
    if DP[n] <= k:
        print("YES")
    else:
        print("NO")
    return 


if __name__ == "__main__":
    main()
0