結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー yu_017yu_017
提出日時 2019-02-02 23:34:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 5,000 ms
コード長 264 bytes
コンパイル時間 6,119 ms
コンパイル使用メモリ 72,208 KB
実行使用メモリ 57,856 KB
最終ジャッジ日時 2023-08-19 23:15:58
合計ジャッジ時間 7,341 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,956 KB
testcase_01 AC 124 ms
53,964 KB
testcase_02 AC 122 ms
55,660 KB
testcase_03 AC 124 ms
57,856 KB
testcase_04 AC 122 ms
55,768 KB
testcase_05 AC 121 ms
55,812 KB
testcase_06 AC 122 ms
55,608 KB
testcase_07 AC 122 ms
55,804 KB
testcase_08 AC 121 ms
55,952 KB
testcase_09 AC 121 ms
55,836 KB
testcase_10 AC 124 ms
55,440 KB
testcase_11 AC 124 ms
55,464 KB
testcase_12 AC 121 ms
55,844 KB
testcase_13 AC 123 ms
53,580 KB
testcase_14 AC 122 ms
56,032 KB
testcase_15 AC 123 ms
55,904 KB
testcase_16 AC 122 ms
55,664 KB
testcase_17 AC 121 ms
56,200 KB
testcase_18 AC 122 ms
56,216 KB
testcase_19 AC 124 ms
55,972 KB
testcase_20 AC 122 ms
56,148 KB
testcase_21 AC 121 ms
56,044 KB
testcase_22 AC 121 ms
55,784 KB
testcase_23 AC 122 ms
56,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class A000047 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		sc.close();
		int r = 0;
		int s = 1;
		while(x-s>0) {
			r++;
			s*=2;
		}

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