結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー jonki324jonki324
提出日時 2018-06-05 14:29:00
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 401 bytes
コンパイル時間 1,984 ms
コンパイル使用メモリ 72,224 KB
実行使用メモリ 56,236 KB
最終ジャッジ日時 2023-09-12 22:24:46
合計ジャッジ時間 6,093 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,952 KB
testcase_01 AC 121 ms
56,144 KB
testcase_02 AC 119 ms
55,516 KB
testcase_03 AC 119 ms
55,904 KB
testcase_04 AC 121 ms
55,800 KB
testcase_05 WA -
testcase_06 AC 121 ms
55,720 KB
testcase_07 AC 119 ms
56,000 KB
testcase_08 AC 119 ms
55,748 KB
testcase_09 AC 120 ms
55,944 KB
testcase_10 AC 120 ms
56,236 KB
testcase_11 AC 119 ms
55,480 KB
testcase_12 AC 120 ms
55,720 KB
testcase_13 AC 120 ms
55,656 KB
testcase_14 AC 123 ms
55,920 KB
testcase_15 AC 120 ms
55,780 KB
testcase_16 AC 120 ms
55,712 KB
testcase_17 AC 121 ms
55,988 KB
testcase_18 AC 121 ms
55,996 KB
testcase_19 AC 123 ms
55,756 KB
testcase_20 AC 121 ms
55,516 KB
testcase_21 AC 122 ms
56,080 KB
testcase_22 AC 122 ms
55,756 KB
testcase_23 AC 122 ms
56,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int b = 1;
        int cnt = 0;
        while (true) {
            b *= 2;
            cnt++;
            if (b >= n) {
                break;
            }
        }
        System.out.println(cnt);
        scan.close();
    }
}
0