結果

問題 No.1465 Archaea
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-04-02 21:55:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 418 bytes
コンパイル時間 134 ms
コンパイル使用メモリ 10,596 KB
実行使用メモリ 78,540 KB
最終ジャッジ日時 2023-08-25 12:08:19
合計ジャッジ時間 3,640 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,852 KB
testcase_01 AC 15 ms
7,788 KB
testcase_02 AC 28 ms
10,088 KB
testcase_03 AC 16 ms
7,792 KB
testcase_04 AC 15 ms
7,788 KB
testcase_05 AC 16 ms
7,788 KB
testcase_06 AC 15 ms
7,824 KB
testcase_07 AC 286 ms
41,964 KB
testcase_08 AC 20 ms
8,736 KB
testcase_09 AC 24 ms
9,304 KB
testcase_10 AC 16 ms
7,824 KB
testcase_11 AC 350 ms
49,352 KB
testcase_12 AC 109 ms
24,904 KB
testcase_13 RE -
testcase_14 AC 48 ms
12,948 KB
testcase_15 AC 16 ms
7,788 KB
testcase_16 AC 16 ms
7,824 KB
testcase_17 AC 17 ms
8,324 KB
testcase_18 AC 16 ms
7,788 KB
testcase_19 AC 15 ms
7,824 KB
testcase_20 AC 17 ms
7,976 KB
testcase_21 RE -
testcase_22 RE -
testcase_23 AC 16 ms
7,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int,input().split())
dic = {}
def dfs(x,left):
    if (x,left) in dic:
        return dic[(x,left)]
    #print(x,left)
    if x < 1:
        return 0
    if x == 1:
        return 1
    if left == 0 and x != 1:
        return 0

    check = 0
    if x%2 == 0:
        check |= dfs(x//2,left-1)
    check |= dfs(x-3,left-1)

    dic[(x,left)] = check

    return check
print("YES" if dfs(n,k) else "NO")

    
0