結果

問題 No.1465 Archaea
ユーザー aaaaaaaaaa2230
提出日時 2021-04-02 21:54:42
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 418 bytes
コンパイル時間 223 ms
コンパイル使用メモリ 81,972 KB
実行使用メモリ 526,952 KB
最終ジャッジ日時 2024-12-23 19:11:38
合計ジャッジ時間 11,868 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 MLE * 1
other AC * 17 TLE * 3
権限があれば一括ダウンロードができます

ソースコード

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