結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー kano_townkano_town
提出日時 2014-11-18 15:41:00
言語 Java21
(openjdk 21)
結果
AC  
実行時間 46 ms / 5,000 ms
コード長 515 bytes
コンパイル時間 2,981 ms
コンパイル使用メモリ 71,628 KB
実行使用メモリ 49,732 KB
最終ジャッジ日時 2023-08-30 20:33:39
合計ジャッジ時間 5,073 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,308 KB
testcase_01 AC 44 ms
49,236 KB
testcase_02 AC 43 ms
49,732 KB
testcase_03 AC 42 ms
49,412 KB
testcase_04 AC 42 ms
49,648 KB
testcase_05 AC 43 ms
49,296 KB
testcase_06 AC 43 ms
49,204 KB
testcase_07 AC 43 ms
49,452 KB
testcase_08 AC 42 ms
49,288 KB
testcase_09 AC 43 ms
49,172 KB
testcase_10 AC 42 ms
49,408 KB
testcase_11 AC 42 ms
49,136 KB
testcase_12 AC 43 ms
49,296 KB
testcase_13 AC 44 ms
49,364 KB
testcase_14 AC 42 ms
49,164 KB
testcase_15 AC 44 ms
49,312 KB
testcase_16 AC 41 ms
49,212 KB
testcase_17 AC 42 ms
49,232 KB
testcase_18 AC 42 ms
49,236 KB
testcase_19 AC 46 ms
49,336 KB
testcase_20 AC 44 ms
49,696 KB
testcase_21 AC 42 ms
49,472 KB
testcase_22 AC 43 ms
49,244 KB
testcase_23 AC 42 ms
49,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Yukicoder47 {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String n = Integer.toBinaryString(Integer.parseInt(br.readLine()));
		int res = n.length() - 1;


		for (int i = 1; i < n.length(); i++) {
			if (n.charAt(i) == '1') {
				res++;
				break;
			}
		}

		System.out.println(res);
	}
}
0