結果
| 問題 | 
                            No.642 Two Operations No.1
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2018-03-18 12:29:15 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 192 bytes | 
| コンパイル時間 | 85 ms | 
| コンパイル使用メモリ | 12,416 KB | 
| 実行使用メモリ | 10,752 KB | 
| 最終ジャッジ日時 | 2024-12-26 00:36:02 | 
| 合計ジャッジ時間 | 1,138 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 7 WA * 8 | 
ソースコード
n = int(input())
ans = 0x3f3f3f3f
for i in range(0, 31):
    u = (1 << i) - n
    if u < 0: continue
    c = i
    while u > 0:
        u >>= 1
        c += 1
    ans = min(ans, c)
print(ans)