結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー spaciaspacia
提出日時 2015-12-15 23:30:49
言語 Java21
(openjdk 21)
結果
AC  
実行時間 40 ms / 5,000 ms
コード長 406 bytes
コンパイル時間 1,646 ms
コンパイル使用メモリ 71,576 KB
実行使用メモリ 49,652 KB
最終ジャッジ日時 2023-10-13 17:12:44
合計ジャッジ時間 3,710 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
49,652 KB
testcase_01 AC 39 ms
47,176 KB
testcase_02 AC 38 ms
49,324 KB
testcase_03 AC 38 ms
49,120 KB
testcase_04 AC 38 ms
49,284 KB
testcase_05 AC 38 ms
49,300 KB
testcase_06 AC 38 ms
49,164 KB
testcase_07 AC 40 ms
49,064 KB
testcase_08 AC 39 ms
49,232 KB
testcase_09 AC 38 ms
49,228 KB
testcase_10 AC 38 ms
49,364 KB
testcase_11 AC 39 ms
49,228 KB
testcase_12 AC 38 ms
49,300 KB
testcase_13 AC 38 ms
49,524 KB
testcase_14 AC 37 ms
49,240 KB
testcase_15 AC 37 ms
49,328 KB
testcase_16 AC 38 ms
49,432 KB
testcase_17 AC 37 ms
49,332 KB
testcase_18 AC 39 ms
49,288 KB
testcase_19 AC 37 ms
49,228 KB
testcase_20 AC 38 ms
49,152 KB
testcase_21 AC 38 ms
49,280 KB
testcase_22 AC 37 ms
49,100 KB
testcase_23 AC 39 ms
49,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;
import java.math.*;

class Main47 {
	
	public static void main (String[] args) throws IOException {
		BufferedReader br = 
			new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		double d = Math.log(n) / Math.log(2);
		
		if (d == (int)d)
			System.out.println((int)d);
		else
			System.out.println((int)d + 1);
		
	}
}
0