結果

問題 No.1465 Archaea
ユーザー 👑 tamatotamato
提出日時 2021-04-02 21:34:53
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 76 ms / 2,000 ms
コード長 463 bytes
コンパイル時間 262 ms
コンパイル使用メモリ 87,304 KB
実行使用メモリ 77,652 KB
最終ジャッジ日時 2023-08-25 16:10:13
合計ジャッジ時間 2,953 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
71,624 KB
testcase_01 AC 62 ms
71,524 KB
testcase_02 AC 62 ms
71,484 KB
testcase_03 AC 62 ms
71,588 KB
testcase_04 AC 62 ms
71,664 KB
testcase_05 AC 70 ms
71,664 KB
testcase_06 AC 67 ms
71,480 KB
testcase_07 AC 75 ms
76,288 KB
testcase_08 AC 67 ms
71,496 KB
testcase_09 AC 74 ms
76,440 KB
testcase_10 AC 63 ms
71,748 KB
testcase_11 AC 73 ms
76,228 KB
testcase_12 AC 69 ms
75,500 KB
testcase_13 AC 75 ms
77,004 KB
testcase_14 AC 72 ms
76,500 KB
testcase_15 AC 66 ms
75,764 KB
testcase_16 AC 65 ms
75,704 KB
testcase_17 AC 75 ms
76,984 KB
testcase_18 AC 73 ms
75,948 KB
testcase_19 AC 71 ms
76,548 KB
testcase_20 AC 72 ms
76,796 KB
testcase_21 AC 73 ms
77,224 KB
testcase_22 AC 76 ms
77,652 KB
testcase_23 AC 63 ms
71,536 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9
inf = 10**18


def main():
    import sys
    input = sys.stdin.readline

    N, K = map(int, input().split())
    cnt = [inf] * (N+1)
    cnt[1] = 0
    for i in range(1, N+1):
        if i + 3 <= N:
            cnt[i+3] = min(cnt[i+3], cnt[i] + 1)
        if i * 2 <= N:
            cnt[i*2] = min(cnt[i*2], cnt[i] + 1)
    if cnt[N] <= K:
        print("YES")
    else:
        print("NO")


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