結果

問題 No.1465 Archaea
ユーザー 👑 H20H20
提出日時 2021-04-02 22:04:47
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 359 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 87,204 KB
実行使用メモリ 148,916 KB
最終ジャッジ日時 2023-08-25 12:19:08
合計ジャッジ時間 3,608 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,800 KB
testcase_01 AC 78 ms
71,692 KB
testcase_02 AC 76 ms
71,588 KB
testcase_03 AC 76 ms
71,836 KB
testcase_04 AC 75 ms
71,664 KB
testcase_05 AC 74 ms
71,692 KB
testcase_06 AC 77 ms
71,884 KB
testcase_07 AC 82 ms
71,756 KB
testcase_08 AC 81 ms
71,676 KB
testcase_09 AC 80 ms
71,900 KB
testcase_10 AC 79 ms
71,596 KB
testcase_11 AC 74 ms
72,180 KB
testcase_12 AC 75 ms
72,248 KB
testcase_13 AC 178 ms
128,188 KB
testcase_14 AC 76 ms
71,644 KB
testcase_15 AC 73 ms
71,496 KB
testcase_16 AC 76 ms
71,664 KB
testcase_17 WA -
testcase_18 AC 74 ms
71,600 KB
testcase_19 AC 75 ms
71,828 KB
testcase_20 AC 75 ms
72,024 KB
testcase_21 AC 216 ms
148,916 KB
testcase_22 AC 216 ms
148,888 KB
testcase_23 AC 74 ms
71,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import defaultdict
sys.setrecursionlimit(1000000)
def bfs(n,k):
    if n==1:
        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