結果

問題 No.1465 Archaea
ユーザー wattaihei
提出日時 2021-04-02 21:54:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 327 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 51,968 KB
最終ジャッジ日時 2024-12-24 01:14:56
合計ジャッジ時間 1,798 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

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

if N%3 == 0:
    ans = False
else:
    ans = False
    while N >= 1 and K >= 0:
        if ((N-1)%3 == 0 and (N-1)//3 <= K):
            ans = True
            break
        if N%2 == 0:
            N //= 2
        else:
            N -= 3
        K -= 1
print("YES" if ans else "NO")
0