結果

問題 No.1465 Archaea
ユーザー 👑 H20H20
提出日時 2021-04-02 22:11:05
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 364 bytes
コンパイル時間 388 ms
コンパイル使用メモリ 81,820 KB
実行使用メモリ 139,004 KB
最終ジャッジ日時 2024-06-06 07:00:59
合計ジャッジ時間 2,641 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
54,192 KB
testcase_01 AC 45 ms
53,960 KB
testcase_02 AC 46 ms
54,568 KB
testcase_03 AC 44 ms
54,908 KB
testcase_04 AC 44 ms
53,844 KB
testcase_05 AC 43 ms
54,608 KB
testcase_06 AC 44 ms
54,388 KB
testcase_07 AC 45 ms
54,232 KB
testcase_08 AC 44 ms
55,252 KB
testcase_09 AC 44 ms
53,424 KB
testcase_10 AC 43 ms
54,860 KB
testcase_11 AC 45 ms
54,664 KB
testcase_12 AC 44 ms
54,464 KB
testcase_13 AC 183 ms
128,280 KB
testcase_14 AC 43 ms
53,772 KB
testcase_15 AC 42 ms
53,652 KB
testcase_16 AC 43 ms
54,148 KB
testcase_17 WA -
testcase_18 AC 42 ms
53,364 KB
testcase_19 AC 43 ms
53,348 KB
testcase_20 AC 43 ms
54,984 KB
testcase_21 AC 215 ms
138,816 KB
testcase_22 AC 214 ms
139,004 KB
testcase_23 AC 43 ms
54,336 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