結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー abcabc
提出日時 2016-10-24 02:34:47
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 5,000 ms
コード長 443 bytes
コンパイル時間 1,947 ms
コンパイル使用メモリ 74,272 KB
実行使用メモリ 56,152 KB
最終ジャッジ日時 2024-05-03 05:09:57
合計ジャッジ時間 5,675 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
53,068 KB
testcase_01 AC 116 ms
54,100 KB
testcase_02 AC 108 ms
52,756 KB
testcase_03 AC 121 ms
54,272 KB
testcase_04 AC 109 ms
53,036 KB
testcase_05 AC 119 ms
53,848 KB
testcase_06 AC 108 ms
52,940 KB
testcase_07 AC 120 ms
54,428 KB
testcase_08 AC 128 ms
54,072 KB
testcase_09 AC 114 ms
53,920 KB
testcase_10 AC 107 ms
52,964 KB
testcase_11 AC 116 ms
53,944 KB
testcase_12 AC 118 ms
54,128 KB
testcase_13 AC 119 ms
53,924 KB
testcase_14 AC 118 ms
54,008 KB
testcase_15 AC 125 ms
54,000 KB
testcase_16 AC 104 ms
52,800 KB
testcase_17 AC 109 ms
53,036 KB
testcase_18 AC 120 ms
54,180 KB
testcase_19 AC 103 ms
54,204 KB
testcase_20 AC 104 ms
53,048 KB
testcase_21 AC 119 ms
56,152 KB
testcase_22 AC 121 ms
54,244 KB
testcase_23 AC 119 ms
54,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int numWantBiscuits = sc.nextInt();

        int numCurrentBiscuits = 1;
        int hitPocketCount = 0;

        while (numCurrentBiscuits < numWantBiscuits) {

            numCurrentBiscuits *= 2;
            hitPocketCount++;

        }

        System.out.println(hitPocketCount);

    }

}
0