結果

問題 No.1286 Stone Skipping
コンテスト
ユーザー 👑 rin204
提出日時 2022-07-05 21:30:41
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 28 ms / 2,000 ms
+ 850µs
コード長 297 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 212 ms
コンパイル使用メモリ 81,916 KB
実行使用メモリ 63,472 KB
最終ジャッジ日時 2026-10-04 11:27:50
合計ジャッジ時間 2,863 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

d = int(input())
ans = 1 << 70
for c in range(70):
    x = (1 << (c + 1)) - 1
    y = d
    while x < y:
        x <<= 1
    l = 0
    while x > 0:
        if y >= x:
            y -= x
            l += 1 << (x.bit_length() - 1)
        x >>= 1
    if y == 0:
        ans = min(ans, l)
print(ans)
0