結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー m4s4k1ch1m4s4k1ch1
提出日時 2015-05-28 23:00:10
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 498 bytes
コンパイル時間 3,620 ms
コンパイル使用メモリ 70,772 KB
実行使用メモリ 51,212 KB
最終ジャッジ日時 2023-09-20 14:58:40
合計ジャッジ時間 4,704 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
49,064 KB
testcase_01 AC 44 ms
49,168 KB
testcase_02 AC 43 ms
49,016 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 43 ms
49,172 KB
testcase_06 AC 44 ms
49,164 KB
testcase_07 AC 43 ms
49,164 KB
testcase_08 AC 44 ms
49,180 KB
testcase_09 AC 43 ms
49,576 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 44 ms
49,824 KB
testcase_16 AC 44 ms
49,036 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 44 ms
49,096 KB
testcase_22 AC 44 ms
49,044 KB
testcase_23 AC 44 ms
49,024 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) {
				if (n == 1 || n % 2 == 0) {
					d1--;
				}
				break;
			}
			d1++;
		}
		
		System.out.println((int)d1);
	}
}
0