結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー FpmpAmpmFpmpAmpm
提出日時 2016-10-22 13:08:05
言語 Java21
(openjdk 21)
結果
AC  
実行時間 130 ms / 5,000 ms
コード長 482 bytes
コンパイル時間 2,105 ms
コンパイル使用メモリ 80,532 KB
実行使用メモリ 41,756 KB
最終ジャッジ日時 2024-05-02 22:09:11
合計ジャッジ時間 5,449 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
40,988 KB
testcase_01 AC 106 ms
41,080 KB
testcase_02 AC 114 ms
41,188 KB
testcase_03 AC 125 ms
41,276 KB
testcase_04 AC 120 ms
41,008 KB
testcase_05 AC 118 ms
41,484 KB
testcase_06 AC 122 ms
41,476 KB
testcase_07 AC 109 ms
41,452 KB
testcase_08 AC 115 ms
41,428 KB
testcase_09 AC 101 ms
41,328 KB
testcase_10 AC 114 ms
41,756 KB
testcase_11 AC 119 ms
41,196 KB
testcase_12 AC 121 ms
40,904 KB
testcase_13 AC 123 ms
41,140 KB
testcase_14 AC 130 ms
41,340 KB
testcase_15 AC 100 ms
41,056 KB
testcase_16 AC 116 ms
40,248 KB
testcase_17 AC 118 ms
41,128 KB
testcase_18 AC 120 ms
41,676 KB
testcase_19 AC 123 ms
41,212 KB
testcase_20 AC 117 ms
40,960 KB
testcase_21 AC 111 ms
41,312 KB
testcase_22 AC 100 ms
41,256 KB
testcase_23 AC 111 ms
41,492 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		Scanner sc = new Scanner(System.in);
    	int n = sc.nextInt();
    	String N = Integer.toBinaryString(n);
    	System.out.println(((n & (n-1)) == 0) ? N.length() - 1 : N.length());
	}
}
0