結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー Hiroaki KonoHiroaki Kono
提出日時 2017-10-26 22:42:58
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 5,000 ms
コード長 361 bytes
コンパイル時間 3,570 ms
コンパイル使用メモリ 73,968 KB
実行使用メモリ 41,472 KB
最終ジャッジ日時 2024-05-01 15:19:27
合計ジャッジ時間 6,538 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
41,472 KB
testcase_01 AC 122 ms
40,940 KB
testcase_02 AC 121 ms
41,208 KB
testcase_03 AC 109 ms
39,816 KB
testcase_04 AC 116 ms
41,340 KB
testcase_05 AC 116 ms
41,396 KB
testcase_06 AC 102 ms
39,932 KB
testcase_07 AC 117 ms
41,344 KB
testcase_08 AC 100 ms
40,188 KB
testcase_09 AC 110 ms
41,372 KB
testcase_10 AC 97 ms
39,680 KB
testcase_11 AC 106 ms
40,012 KB
testcase_12 AC 115 ms
40,948 KB
testcase_13 AC 113 ms
41,248 KB
testcase_14 AC 102 ms
39,784 KB
testcase_15 AC 113 ms
41,324 KB
testcase_16 AC 117 ms
40,864 KB
testcase_17 AC 116 ms
41,032 KB
testcase_18 AC 115 ms
40,908 KB
testcase_19 AC 118 ms
41,052 KB
testcase_20 AC 115 ms
41,200 KB
testcase_21 AC 101 ms
40,084 KB
testcase_22 AC 115 ms
41,104 KB
testcase_23 AC 114 ms
41,132 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No47 {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int biscuits = s.nextInt();
        int current = 1;
        int tapped = 0;
        while (current < biscuits) {
            current *= 2;
            tapped++;
        }
        System.out.println(tapped);
    }
}
0