結果

問題 No.1465 Archaea
ユーザー c-yanc-yan
提出日時 2021-04-02 22:15:26
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 388 bytes
コンパイル時間 239 ms
コンパイル使用メモリ 10,640 KB
実行使用メモリ 12,492 KB
最終ジャッジ日時 2023-08-25 12:27:20
合計ジャッジ時間 4,449 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,964 KB
testcase_01 AC 16 ms
7,820 KB
testcase_02 AC 366 ms
8,192 KB
testcase_03 AC 15 ms
7,852 KB
testcase_04 AC 16 ms
7,924 KB
testcase_05 AC 15 ms
7,908 KB
testcase_06 AC 15 ms
7,856 KB
testcase_07 AC 15 ms
7,784 KB
testcase_08 AC 15 ms
7,848 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import setrecursionlimit
setrecursionlimit(10 ** 6)
N, K = map(int, input().split())

def f(n, k):
    if k > K:
        return False
    if n == 1:
        return True
    if n % 2 == 0:
        result = f(n // 2, k + 1)
        if result:
            return True
    if n > 3:
        return f(n - 3, k + 1)
    return False

if f(N, 0):
    print('YES')
else:
    print('NO')
0