結果

問題 No.1465 Archaea
ユーザー ayaoniayaoni
提出日時 2021-04-06 21:42:15
言語 PyPy3
(7.3.13)
結果
WA  
実行時間 -
コード長 681 bytes
コンパイル時間 1,092 ms
コンパイル使用メモリ 86,772 KB
実行使用メモリ 77,516 KB
最終ジャッジ日時 2023-09-02 13:01:55
合計ジャッジ時間 4,500 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
77,296 KB
testcase_01 AC 83 ms
77,220 KB
testcase_02 AC 84 ms
77,264 KB
testcase_03 AC 83 ms
77,472 KB
testcase_04 AC 83 ms
77,344 KB
testcase_05 AC 83 ms
77,304 KB
testcase_06 AC 85 ms
77,272 KB
testcase_07 AC 84 ms
77,460 KB
testcase_08 AC 85 ms
77,468 KB
testcase_09 AC 90 ms
77,328 KB
testcase_10 AC 84 ms
77,436 KB
testcase_11 AC 83 ms
77,420 KB
testcase_12 AC 84 ms
77,344 KB
testcase_13 AC 84 ms
77,184 KB
testcase_14 AC 84 ms
77,340 KB
testcase_15 AC 84 ms
77,328 KB
testcase_16 AC 85 ms
77,376 KB
testcase_17 AC 84 ms
77,272 KB
testcase_18 AC 83 ms
77,336 KB
testcase_19 AC 83 ms
77,212 KB
testcase_20 AC 90 ms
77,516 KB
testcase_21 AC 89 ms
77,468 KB
testcase_22 AC 89 ms
77,400 KB
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def LS2(): return list(sys.stdin.readline().rstrip())


N,K = MI()

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

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