結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー Coffee_drunk
提出日時 2017-07-11 23:53:11
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 233 bytes
コンパイル時間 389 ms
コンパイル使用メモリ 29,056 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-07 15:10:57
合計ジャッジ時間 1,326 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
#include<math.h>

int calc(int n){

  int a=1;
  int i=0;
  while(1){
    if(a<n){
    a = a*2;
    i++;
    }
    else
    break;
  }
  return i;
}

int main(){
  int a;
  scanf("%d",&a);
  printf("%d",calc(a));
}
0