結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー taichi_hobbiestaichi_hobbies
提出日時 2019-06-01 18:26:45
言語 Java21
(openjdk 21)
結果
AC  
実行時間 135 ms / 5,000 ms
コード長 285 bytes
コンパイル時間 3,336 ms
コンパイル使用メモリ 73,992 KB
実行使用メモリ 57,716 KB
最終ジャッジ日時 2023-10-17 22:49:34
合計ジャッジ時間 7,541 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
57,144 KB
testcase_01 AC 130 ms
57,528 KB
testcase_02 AC 131 ms
57,408 KB
testcase_03 AC 129 ms
57,452 KB
testcase_04 AC 132 ms
57,460 KB
testcase_05 AC 131 ms
57,488 KB
testcase_06 AC 132 ms
57,464 KB
testcase_07 AC 132 ms
57,508 KB
testcase_08 AC 133 ms
57,716 KB
testcase_09 AC 132 ms
57,060 KB
testcase_10 AC 132 ms
57,440 KB
testcase_11 AC 131 ms
57,388 KB
testcase_12 AC 135 ms
57,528 KB
testcase_13 AC 129 ms
57,484 KB
testcase_14 AC 133 ms
57,168 KB
testcase_15 AC 131 ms
57,328 KB
testcase_16 AC 131 ms
57,452 KB
testcase_17 AC 133 ms
57,444 KB
testcase_18 AC 133 ms
57,436 KB
testcase_19 AC 133 ms
57,412 KB
testcase_20 AC 131 ms
57,452 KB
testcase_21 AC 132 ms
57,576 KB
testcase_22 AC 132 ms
57,552 KB
testcase_23 AC 127 ms
57,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Question47 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		double fN = (double)N;

		int count = 0;
		while (fN > 1){
			fN /= 2;
			count++;
		};

		System.out.println(count);
	}

}
0