結果

問題 No.1465 Archaea
ユーザー 👑 H20H20
提出日時 2021-04-02 22:07:46
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 365 bytes
コンパイル時間 387 ms
コンパイル使用メモリ 87,280 KB
実行使用メモリ 148,764 KB
最終ジャッジ日時 2023-08-25 12:21:03
合計ジャッジ時間 4,146 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
71,428 KB
testcase_01 AC 92 ms
71,864 KB
testcase_02 AC 91 ms
71,924 KB
testcase_03 WA -
testcase_04 AC 92 ms
71,428 KB
testcase_05 AC 91 ms
71,968 KB
testcase_06 AC 93 ms
71,848 KB
testcase_07 AC 93 ms
72,036 KB
testcase_08 AC 91 ms
71,828 KB
testcase_09 AC 88 ms
71,724 KB
testcase_10 AC 91 ms
71,716 KB
testcase_11 AC 93 ms
71,828 KB
testcase_12 AC 93 ms
72,328 KB
testcase_13 AC 210 ms
126,840 KB
testcase_14 AC 91 ms
71,756 KB
testcase_15 AC 92 ms
71,664 KB
testcase_16 AC 90 ms
71,900 KB
testcase_17 WA -
testcase_18 AC 92 ms
71,860 KB
testcase_19 AC 90 ms
71,604 KB
testcase_20 AC 91 ms
71,836 KB
testcase_21 AC 251 ms
148,492 KB
testcase_22 AC 258 ms
148,764 KB
testcase_23 AC 90 ms
71,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import defaultdict
sys.setrecursionlimit(1000000)
def bfs(n,k):
    if n==1 and k>=0:
        print('YES')
        exit()
    if n<=0 or k<0:
        return
    if d[n]==1:
        return
    d[n]=1
    bfs(n-3,k-1)
    if n%2==0:
        bfs(n//2,k-1)





N,K = map(int,input().split())
d = defaultdict(lambda: 0)

bfs(N,K)
print('NO')
0