結果
問題 |
No.1286 Stone Skipping
|
ユーザー |
👑 |
提出日時 | 2022-07-05 21:30:41 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 51 ms / 2,000 ms |
コード長 | 297 bytes |
コンパイル時間 | 455 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 59,264 KB |
最終ジャッジ日時 | 2024-12-16 07:50:27 |
合計ジャッジ時間 | 2,965 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 |
ソースコード
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)