結果

問題 No.642 Two Operations No.1
ユーザー Drakkon
提出日時 2018-02-03 12:59:18
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 237 bytes
コンパイル時間 1,142 ms
コンパイル使用メモリ 28,160 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-11 15:20:29
合計ジャッジ時間 1,684 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
int main(void){
    int N, i = 0, X = 1;
    scanf("%d", &N);
    while(X < N){
        X *= 2;
        i++;
    }
    while(X != N){
        X--;
        i++;
    }
    printf("%d\n", i);
    return 0;
}
0