結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー Daigo HIROOKA
提出日時 2018-05-13 22:53:04
言語 Java
(openjdk 23)
結果
RE  
実行時間 -
コード長 551 bytes
コンパイル時間 3,378 ms
コンパイル使用メモリ 74,096 KB
実行使用メモリ 41,508 KB
最終ジャッジ日時 2024-06-28 10:44:34
合計ジャッジ時間 7,590 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20 RE * 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();
        if(N == 1){
            System.out.println(0);
            System.exit(1);
        }
        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