結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー Daigo HIROOKADaigo HIROOKA
提出日時 2018-05-13 22:48:38
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 458 bytes
コンパイル時間 3,453 ms
コンパイル使用メモリ 72,196 KB
実行使用メモリ 57,840 KB
最終ジャッジ日時 2023-09-10 19:36:49
合計ジャッジ時間 7,598 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,392 KB
testcase_01 AC 126 ms
53,728 KB
testcase_02 AC 128 ms
55,744 KB
testcase_03 AC 127 ms
55,588 KB
testcase_04 AC 124 ms
55,840 KB
testcase_05 WA -
testcase_06 AC 125 ms
55,440 KB
testcase_07 AC 128 ms
55,876 KB
testcase_08 AC 127 ms
55,708 KB
testcase_09 AC 127 ms
57,584 KB
testcase_10 AC 128 ms
55,572 KB
testcase_11 AC 126 ms
55,636 KB
testcase_12 AC 128 ms
55,576 KB
testcase_13 AC 127 ms
57,684 KB
testcase_14 AC 126 ms
55,736 KB
testcase_15 AC 126 ms
55,684 KB
testcase_16 AC 127 ms
55,628 KB
testcase_17 AC 128 ms
56,028 KB
testcase_18 AC 127 ms
55,604 KB
testcase_19 AC 127 ms
55,792 KB
testcase_20 AC 127 ms
55,744 KB
testcase_21 AC 125 ms
55,824 KB
testcase_22 AC 126 ms
55,488 KB
testcase_23 AC 126 ms
55,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class PocketBiscuit{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int num_bis = 1;
        int num_hit = 0;
        while(true){
            if(num_bis*2<N){
                num_bis = num_bis*2;
                num_hit++;
            }else{
                System.out.println(num_hit+1);
                break;
            }
        }
    }
}
0