結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー scachescache
提出日時 2014-10-22 00:13:47
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 5,000 ms
コード長 433 bytes
コンパイル時間 3,830 ms
コンパイル使用メモリ 72,164 KB
実行使用メモリ 56,372 KB
最終ジャッジ日時 2023-08-28 22:32:11
合計ジャッジ時間 7,387 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
56,328 KB
testcase_01 AC 124 ms
55,828 KB
testcase_02 AC 123 ms
55,692 KB
testcase_03 AC 124 ms
55,764 KB
testcase_04 AC 125 ms
55,820 KB
testcase_05 AC 125 ms
56,072 KB
testcase_06 AC 123 ms
55,812 KB
testcase_07 AC 124 ms
55,680 KB
testcase_08 AC 125 ms
56,352 KB
testcase_09 AC 127 ms
55,800 KB
testcase_10 AC 124 ms
56,324 KB
testcase_11 AC 124 ms
55,996 KB
testcase_12 AC 123 ms
56,092 KB
testcase_13 AC 123 ms
55,856 KB
testcase_14 AC 123 ms
55,856 KB
testcase_15 AC 123 ms
56,072 KB
testcase_16 AC 125 ms
55,792 KB
testcase_17 AC 125 ms
55,712 KB
testcase_18 AC 120 ms
55,568 KB
testcase_19 AC 121 ms
55,980 KB
testcase_20 AC 121 ms
56,044 KB
testcase_21 AC 121 ms
56,372 KB
testcase_22 AC 121 ms
55,848 KB
testcase_23 AC 123 ms
55,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main47 {
	public static void main(String[] args) {
		Main47 p = new Main47();
	}

	public Main47() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		solve(n);
	}

	public void solve(int n) {
		if(Integer.bitCount(n)==1)
			System.out.println(31-Integer.numberOfLeadingZeros(n));
		else
			System.out.println(31-Integer.numberOfLeadingZeros(n)+1);
	}

}
0