結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー tekitouk
提出日時 2015-07-13 01:47:36
言語 C90
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 203 bytes
コンパイル時間 72 ms
コンパイル使用メモリ 19,968 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-08 06:14:36
合計ジャッジ時間 722 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         scanf("%d",&N);
      |         ^~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(){

	int N;

	scanf("%d",&N);

	int i;

	int cookie = 1;
	int cnt = 0;

	while (1){
		if (cookie >= N){ break; }
		cookie *= 2;
		cnt++;
	}
	printf("%d\n",cnt);

	return 0;
}
0