結果

問題 No.1465 Archaea
ユーザー H3PO4H3PO4
提出日時 2021-04-02 21:46:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 359 bytes
コンパイル時間 320 ms
コンパイル使用メモリ 10,588 KB
実行使用メモリ 11,512 KB
最終ジャッジ日時 2023-08-25 16:11:39
合計ジャッジ時間 2,212 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,940 KB
testcase_01 AC 15 ms
7,836 KB
testcase_02 AC 15 ms
7,800 KB
testcase_03 AC 16 ms
7,920 KB
testcase_04 AC 15 ms
7,876 KB
testcase_05 AC 16 ms
7,796 KB
testcase_06 AC 15 ms
7,856 KB
testcase_07 AC 34 ms
9,132 KB
testcase_08 AC 34 ms
7,832 KB
testcase_09 AC 45 ms
9,364 KB
testcase_10 AC 16 ms
7,860 KB
testcase_11 AC 40 ms
9,284 KB
testcase_12 AC 25 ms
7,860 KB
testcase_13 AC 113 ms
10,616 KB
testcase_14 AC 40 ms
9,312 KB
testcase_15 AC 16 ms
7,972 KB
testcase_16 AC 16 ms
7,856 KB
testcase_17 AC 74 ms
10,876 KB
testcase_18 AC 16 ms
8,180 KB
testcase_19 AC 17 ms
8,600 KB
testcase_20 AC 32 ms
9,952 KB
testcase_21 AC 133 ms
11,452 KB
testcase_22 AC 132 ms
11,512 KB
testcase_23 AC 15 ms
7,804 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())

nonvisited = [True] * (N + 1)
nonvisited[1] = False

ok = [1]
for _ in range(K):
    new_ok = []
    for x in ok:
        for tmp in (x + 3, x * 2):
            if tmp <= N and nonvisited[tmp]:
                nonvisited[tmp] = False
                new_ok.append(tmp)
    ok = new_ok
print('NO' if nonvisited[N] else 'YES')
0