結果

問題 No.1465 Archaea
ユーザー 👑 H20H20
提出日時 2021-04-02 22:06:24
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 358 bytes
コンパイル時間 349 ms
コンパイル使用メモリ 86,980 KB
実行使用メモリ 149,512 KB
最終ジャッジ日時 2023-08-25 12:20:22
合計ジャッジ時間 4,291 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
71,868 KB
testcase_01 AC 94 ms
71,836 KB
testcase_02 AC 89 ms
72,100 KB
testcase_03 WA -
testcase_04 AC 87 ms
71,768 KB
testcase_05 AC 89 ms
71,756 KB
testcase_06 AC 89 ms
71,752 KB
testcase_07 AC 89 ms
72,036 KB
testcase_08 AC 88 ms
71,856 KB
testcase_09 AC 90 ms
72,036 KB
testcase_10 AC 89 ms
71,908 KB
testcase_11 AC 90 ms
71,976 KB
testcase_12 AC 89 ms
71,824 KB
testcase_13 AC 212 ms
128,228 KB
testcase_14 AC 89 ms
71,868 KB
testcase_15 AC 89 ms
71,944 KB
testcase_16 AC 89 ms
71,896 KB
testcase_17 WA -
testcase_18 AC 89 ms
71,628 KB
testcase_19 AC 90 ms
71,648 KB
testcase_20 AC 90 ms
71,756 KB
testcase_21 AC 258 ms
149,512 KB
testcase_22 AC 257 ms
147,732 KB
testcase_23 AC 89 ms
71,672 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import defaultdict
sys.setrecursionlimit(1000000)
def bfs(n,k):
    if n<=0 or k<0:
        return
    if d[n]==1:
        return
    if n==1:
        print('YES')
        exit()
    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