結果

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

ソースコード

diff #

#include <stdio.h>

int main(void){
	int n, cnt=1;
	int ans;
	scanf("%d", &n);
	
	for(ans=0;ans<30;ans++){
		if( n <= cnt ){
			break;
		}
		cnt*=2;
	}
	
	printf("%d\n", ans);
	return 0;
}
0