結果

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

ソースコード

diff #

import java.util.Scanner;

public class Main{
	static int f(int x){
		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