結果

問題 No.1465 Archaea
ユーザー ygd.ygd.
提出日時 2021-04-02 21:44:16
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
WA  
実行時間 -
コード長 415 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 10,596 KB
実行使用メモリ 12,720 KB
最終ジャッジ日時 2023-08-25 11:53:50
合計ジャッジ時間 4,300 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
12,232 KB
testcase_01 AC 16 ms
7,784 KB
testcase_02 AC 449 ms
8,128 KB
testcase_03 AC 15 ms
7,784 KB
testcase_04 WA -
testcase_05 AC 16 ms
7,744 KB
testcase_06 AC 16 ms
7,864 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
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 #

import sys
sys.setrecursionlimit(500000) 
N,K = map(int,input().split())

def solve(n,k):
    if k == 0:
        if n == 1:
            return 1
        else:
            return 0
    if n == 1 and k >= 0:
        return 0
    Flag = 0
    if n > 3:
        Flag |= solve(n-3,k-1)
    if n%2 == 0:
        Flag |= solve(n//2,k-1)
    return Flag

ans = solve(N,K)
if ans == 1:
    print("YES")
else:
    print("NO")
0