結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー m4s4k1ch1m4s4k1ch1
提出日時 2015-05-28 23:10:18
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 544 bytes
コンパイル時間 1,850 ms
コンパイル使用メモリ 71,188 KB
実行使用メモリ 49,632 KB
最終ジャッジ日時 2023-09-20 15:00:07
合計ジャッジ時間 3,895 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
49,140 KB
testcase_01 AC 43 ms
49,268 KB
testcase_02 AC 42 ms
49,212 KB
testcase_03 AC 43 ms
49,220 KB
testcase_04 AC 43 ms
49,264 KB
testcase_05 WA -
testcase_06 AC 43 ms
49,280 KB
testcase_07 AC 42 ms
49,108 KB
testcase_08 AC 42 ms
49,280 KB
testcase_09 AC 43 ms
49,436 KB
testcase_10 AC 43 ms
49,084 KB
testcase_11 AC 43 ms
49,068 KB
testcase_12 AC 43 ms
49,140 KB
testcase_13 AC 43 ms
47,352 KB
testcase_14 AC 42 ms
49,348 KB
testcase_15 AC 42 ms
49,400 KB
testcase_16 AC 42 ms
49,216 KB
testcase_17 AC 43 ms
49,284 KB
testcase_18 AC 43 ms
49,248 KB
testcase_19 AC 43 ms
49,204 KB
testcase_20 AC 42 ms
49,112 KB
testcase_21 AC 43 ms
49,212 KB
testcase_22 AC 42 ms
49,256 KB
testcase_23 AC 42 ms
49,432 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