結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー AoiroFukurouAoiroFukurou
提出日時 2016-11-09 16:34:18
言語 Java21
(openjdk 21)
結果
AC  
実行時間 140 ms / 5,000 ms
コード長 293 bytes
コンパイル時間 3,382 ms
コンパイル使用メモリ 74,244 KB
実行使用メモリ 41,508 KB
最終ジャッジ日時 2024-05-04 00:18:36
合計ジャッジ時間 7,672 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
41,368 KB
testcase_01 AC 134 ms
41,508 KB
testcase_02 AC 136 ms
40,992 KB
testcase_03 AC 133 ms
41,340 KB
testcase_04 AC 129 ms
41,028 KB
testcase_05 AC 130 ms
41,196 KB
testcase_06 AC 134 ms
41,376 KB
testcase_07 AC 137 ms
41,284 KB
testcase_08 AC 138 ms
41,316 KB
testcase_09 AC 137 ms
41,292 KB
testcase_10 AC 136 ms
41,100 KB
testcase_11 AC 140 ms
41,396 KB
testcase_12 AC 133 ms
41,220 KB
testcase_13 AC 131 ms
40,948 KB
testcase_14 AC 130 ms
41,248 KB
testcase_15 AC 131 ms
41,256 KB
testcase_16 AC 131 ms
41,316 KB
testcase_17 AC 135 ms
41,196 KB
testcase_18 AC 135 ms
41,252 KB
testcase_19 AC 132 ms
41,364 KB
testcase_20 AC 118 ms
39,992 KB
testcase_21 AC 133 ms
41,212 KB
testcase_22 AC 134 ms
41,336 KB
testcase_23 AC 131 ms
41,240 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class No_047 {
public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int N = sc.nextInt();
	int b = 1;
	int ans = 0;
	while(b * 2 <= N){
		b *= 2;
		ans++;
	}
	if(b != N){
		ans++;
	}
System.out.println(ans);
}
}
0