結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー econo_coffeeecono_coffee
提出日時 2017-03-12 23:30:54
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 5,000 ms
コード長 352 bytes
コンパイル時間 5,350 ms
コンパイル使用メモリ 71,524 KB
実行使用メモリ 56,124 KB
最終ジャッジ日時 2023-09-12 12:11:13
合計ジャッジ時間 8,085 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
56,108 KB
testcase_01 AC 122 ms
55,620 KB
testcase_02 AC 119 ms
56,088 KB
testcase_03 AC 121 ms
55,448 KB
testcase_04 AC 120 ms
55,628 KB
testcase_05 AC 121 ms
55,864 KB
testcase_06 AC 121 ms
55,952 KB
testcase_07 AC 121 ms
55,348 KB
testcase_08 AC 123 ms
55,636 KB
testcase_09 AC 122 ms
55,780 KB
testcase_10 AC 122 ms
56,080 KB
testcase_11 AC 120 ms
55,800 KB
testcase_12 AC 120 ms
55,884 KB
testcase_13 AC 122 ms
55,872 KB
testcase_14 AC 120 ms
55,972 KB
testcase_15 AC 125 ms
56,000 KB
testcase_16 AC 124 ms
56,124 KB
testcase_17 AC 124 ms
55,628 KB
testcase_18 AC 123 ms
55,700 KB
testcase_19 AC 121 ms
55,924 KB
testcase_20 AC 125 ms
55,752 KB
testcase_21 AC 125 ms
55,724 KB
testcase_22 AC 127 ms
55,848 KB
testcase_23 AC 123 ms
55,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Yukicoder {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int biscuit = 1;
        int count = 0;
        while (N > biscuit) {
            biscuit *= 2;
            count++;
        }

        System.out.println(count);
    }
}
0