結果
| 問題 | 
                            No.642 Two Operations No.1
                             | 
                    
| コンテスト | |
| ユーザー | 
                             kwnwsdnc
                         | 
                    
| 提出日時 | 2018-02-22 18:52:34 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 221 bytes | 
| コンパイル時間 | 247 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 17,696 KB | 
| 最終ジャッジ日時 | 2024-10-02 07:45:44 | 
| 合計ジャッジ時間 | 6,838 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 4 TLE * 2 -- * 9 | 
ソースコード
def double(n):
    return 2*n
def minus(n):
    return n-1
        
x=1
i=0
N=int(input())
while N%2==0:
    N=N/2
    i+=1
while x<N:
    x=double(x)
    i+=1
while x>N:
    x=minus(x)
    i+=1
print('%d'%i)
    
    
            
            
            
        
            
kwnwsdnc