結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー mits58
提出日時 2016-05-05 14:31:31
言語 Java
(openjdk 23)
結果
AC  
実行時間 126 ms / 5,000 ms
コード長 356 bytes
コンパイル時間 2,060 ms
コンパイル使用メモリ 74,140 KB
実行使用メモリ 54,196 KB
最終ジャッジ日時 2024-10-05 09:36:49
合計ジャッジ時間 5,116 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main{
	static int f(int x){
		if(x==1) return 0;
		for(int i=1;;i++){
			if(Math.pow(2, i)>=x){
				return i;
			}
		}
	}
	public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        while(sc.hasNext()){
        	int n=sc.nextInt();
        	System.out.println(f(n));
        }
    }
}
0