結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー m4s4k1ch1m4s4k1ch1
提出日時 2015-05-28 22:55:30
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 461 bytes
コンパイル時間 2,622 ms
コンパイル使用メモリ 70,988 KB
実行使用メモリ 51,544 KB
最終ジャッジ日時 2023-09-20 14:56:15
合計ジャッジ時間 3,934 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,164 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 42 ms
49,348 KB
testcase_04 AC 42 ms
49,040 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 42 ms
49,160 KB
testcase_08 AC 43 ms
49,288 KB
testcase_09 AC 43 ms
49,288 KB
testcase_10 AC 42 ms
49,112 KB
testcase_11 AC 43 ms
49,712 KB
testcase_12 AC 42 ms
49,352 KB
testcase_13 AC 42 ms
49,292 KB
testcase_14 AC 43 ms
49,120 KB
testcase_15 AC 43 ms
49,296 KB
testcase_16 AC 42 ms
49,672 KB
testcase_17 AC 43 ms
49,040 KB
testcase_18 AC 43 ms
49,048 KB
testcase_19 AC 43 ms
49,572 KB
testcase_20 AC 43 ms
49,228 KB
testcase_21 AC 43 ms
49,340 KB
testcase_22 AC 43 ms
49,152 KB
testcase_23 AC 42 ms
49,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String args[]) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = br.readLine();
		int n = Integer.parseInt(line);
		
		double d1 = 1;
		double d2 = 0;
		while(true) {
			d2 = Math.pow(2, d1);
			if (d2 > n) {
//				d1--;
				break;
			}
			d1++;
		}
		
		System.out.println((int)d1);
	}
}
0