結果
問題 |
No.1465 Archaea
|
ユーザー |
![]() |
提出日時 | 2025-02-01 16:41:33 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 495 bytes |
コンパイル時間 | 737 ms |
コンパイル使用メモリ | 82,504 KB |
実行使用メモリ | 71,900 KB |
最終ジャッジ日時 | 2025-02-01 16:41:37 |
合計ジャッジ時間 | 3,115 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 14 WA * 6 |
ソースコード
N, K = map(int, input().split()) if N % 3 == 0: print("NO") exit() if K > N // 3 + 1: print("NO") exit() INF = K + 1 X = [INF] * (N + 1) Q = [1] for i in range(1, K + 1): Q2 = [] while Q: x = Q.pop() if x + 3 <= N and X[x + 3] == INF: X[x + 3] = i Q2.append(x + 3) if x * 2 <= N and X[x * 2] == INF: X[x * 2] = i Q2.append(x * 2) Q,Q2 = Q2,Q if X[N] <= K: print("YES") else: print("NO")