結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー yoneoka1985yoneoka1985
提出日時 2018-10-10 20:20:05
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 5,000 ms
コード長 526 bytes
コンパイル時間 2,175 ms
コンパイル使用メモリ 73,772 KB
実行使用メモリ 41,500 KB
最終ジャッジ日時 2024-04-20 19:29:12
合計ジャッジ時間 5,332 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
41,096 KB
testcase_01 AC 126 ms
41,280 KB
testcase_02 AC 108 ms
39,936 KB
testcase_03 AC 120 ms
41,116 KB
testcase_04 AC 115 ms
41,104 KB
testcase_05 AC 116 ms
41,500 KB
testcase_06 AC 108 ms
41,060 KB
testcase_07 AC 105 ms
40,844 KB
testcase_08 AC 112 ms
40,808 KB
testcase_09 AC 105 ms
39,672 KB
testcase_10 AC 104 ms
40,240 KB
testcase_11 AC 97 ms
39,940 KB
testcase_12 AC 101 ms
40,280 KB
testcase_13 AC 115 ms
41,144 KB
testcase_14 AC 111 ms
41,184 KB
testcase_15 AC 106 ms
40,588 KB
testcase_16 AC 102 ms
40,264 KB
testcase_17 AC 111 ms
41,040 KB
testcase_18 AC 118 ms
39,828 KB
testcase_19 AC 110 ms
41,324 KB
testcase_20 AC 114 ms
39,896 KB
testcase_21 AC 118 ms
41,192 KB
testcase_22 AC 113 ms
41,304 KB
testcase_23 AC 100 ms
40,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        // 標準入力から読み込む際に、Scannerオブジェクトを使う。
        Scanner sc = new Scanner(System.in);

        // int 1つ分を読み込む
        int n = sc.nextInt();
        int biscuits = 1;
        int count = 0;
        while(biscuits < n){
            biscuits = biscuits * 2;
            count++;
        }
        // 標準出力に書き出す。
        System.out.println(count);
    }
}
0