結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー m4s4k1ch1m4s4k1ch1
提出日時 2015-05-28 23:09:30
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 543 bytes
コンパイル時間 1,983 ms
コンパイル使用メモリ 71,996 KB
実行使用メモリ 49,556 KB
最終ジャッジ日時 2023-09-20 14:59:35
合計ジャッジ時間 4,084 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
49,344 KB
testcase_01 AC 43 ms
49,196 KB
testcase_02 AC 43 ms
49,036 KB
testcase_03 AC 44 ms
49,412 KB
testcase_04 AC 43 ms
49,272 KB
testcase_05 WA -
testcase_06 AC 42 ms
49,252 KB
testcase_07 AC 42 ms
49,100 KB
testcase_08 AC 43 ms
49,096 KB
testcase_09 AC 42 ms
49,104 KB
testcase_10 AC 42 ms
49,108 KB
testcase_11 AC 42 ms
49,332 KB
testcase_12 AC 44 ms
49,548 KB
testcase_13 AC 43 ms
49,556 KB
testcase_14 AC 42 ms
49,096 KB
testcase_15 AC 42 ms
49,100 KB
testcase_16 AC 42 ms
49,260 KB
testcase_17 AC 41 ms
47,560 KB
testcase_18 AC 42 ms
49,184 KB
testcase_19 AC 42 ms
49,360 KB
testcase_20 AC 42 ms
49,104 KB
testcase_21 AC 42 ms
49,048 KB
testcase_22 AC 41 ms
49,356 KB
testcase_23 AC 42 ms
49,060 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;
		if (n < 2) {
			System.out.println("0");
		}
		while(true) {
			d2 = Math.pow(2, d1);
			if (d2 > n) {
//					d1--;
				break;
			}
			if (n == d2) {
				break;
			}
			d1++;
		}
		
		System.out.println((int)d1);
	}
}
0