結果

問題 No.642 Two Operations No.1
ユーザー Prai
提出日時 2018-03-21 23:51:38
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 358 bytes
コンパイル時間 260 ms
コンパイル使用メモリ 28,928 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-24 19:44:31
合計ジャッジ時間 986 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
/*XをNにする	-> NをXにする*/

int Operation_Subtract(int);
int Operation_Double(int);


int main(void){
	int N,X=1;
	int count=0;

	scanf("%d",&N);

while( N > 1 ){
        if( N%2 == 1 ){ 
            N++;    
            count++;    
        }
  
        N /= 2; 
        count++;    
    }

	printf("%d\n",count);

	return 0;
}
0