結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー Daigo HIROOKA
提出日時 2018-05-13 22:48:38
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 458 bytes
コンパイル時間 3,323 ms
コンパイル使用メモリ 74,340 KB
実行使用メモリ 41,440 KB
最終ジャッジ日時 2024-06-28 10:44:11
合計ジャッジ時間 7,311 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20 WA * 1
権限があれば一括ダウンロードができます

ソースコード

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