結果

問題 No.1465 Archaea
ユーザー AEnAEn
提出日時 2022-06-15 00:38:36
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 378 bytes
コンパイル時間 196 ms
コンパイル使用メモリ 82,580 KB
実行使用メモリ 73,612 KB
最終ジャッジ日時 2024-04-14 06:28:32
合計ジャッジ時間 2,617 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
53,956 KB
testcase_01 AC 42 ms
54,736 KB
testcase_02 AC 42 ms
55,180 KB
testcase_03 AC 42 ms
55,500 KB
testcase_04 AC 42 ms
54,008 KB
testcase_05 AC 41 ms
54,460 KB
testcase_06 AC 42 ms
55,884 KB
testcase_07 AC 58 ms
66,708 KB
testcase_08 AC 42 ms
54,548 KB
testcase_09 AC 61 ms
67,844 KB
testcase_10 AC 42 ms
54,664 KB
testcase_11 AC 59 ms
67,108 KB
testcase_12 AC 47 ms
60,816 KB
testcase_13 AC 69 ms
72,092 KB
testcase_14 AC 60 ms
68,172 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 70 ms
72,232 KB
testcase_18 AC 55 ms
64,652 KB
testcase_19 WA -
testcase_20 AC 67 ms
70,780 KB
testcase_21 AC 72 ms
72,896 KB
testcase_22 AC 71 ms
73,612 KB
testcase_23 AC 42 ms
55,772 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque

N, K = map(int, input().split())
is_ok = [False]*(N+1)
is_ok[1] = True
d = deque()
d.append(1)
while d:
    p = d.popleft()
    if p*2<=N and is_ok[p*2]==False:
        is_ok[p*2] = True
        d.append(p*2)
    if p+3<=N and is_ok[p+3]==False:
        is_ok[p+3] = True
        d.append(p+3)
if is_ok[-1]:
    print('YES')
else:
    print('NO')
0