結果
問題 |
No.2241 Reach 1
|
ユーザー |
![]() |
提出日時 | 2025-04-16 01:04:15 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 36 ms / 2,000 ms |
コード長 | 330 bytes |
コンパイル時間 | 151 ms |
コンパイル使用メモリ | 82,484 KB |
実行使用メモリ | 53,720 KB |
最終ジャッジ日時 | 2025-04-16 01:06:20 |
合計ジャッジ時間 | 2,127 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 35 |
ソースコード
n = int(input()) cnt = 0 # Divide by the maximum possible power of 2 each time while n % 2 == 0: lsb = n & -n # Find the least significant bit (max power of 2 dividing n) n //= lsb cnt += 1 # If the remaining n is greater than 1, add 2 operations (multiply and add 1, then divide) if n > 1: cnt += 2 print(cnt)