結果
| 問題 | No.1465 Archaea | 
| コンテスト | |
| ユーザー |  ntuda | 
| 提出日時 | 2025-02-01 16:45:28 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 74 ms / 2,000 ms | 
| コード長 | 458 bytes | 
| コンパイル時間 | 489 ms | 
| コンパイル使用メモリ | 82,400 KB | 
| 実行使用メモリ | 78,748 KB | 
| 最終ジャッジ日時 | 2025-02-01 16:45:31 | 
| 合計ジャッジ時間 | 3,055 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 20 | 
ソースコード
N, K = map(int, input().split())
if N % 3 == 0:
    print("NO")
    exit()
INF = K + 1
X = [INF] * (N + 1)
X[1] = 0
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")
            
            
            
        