結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー keitamidokeitamido
提出日時 2017-06-12 08:03:39
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 319 bytes
コンパイル時間 2,034 ms
コンパイル使用メモリ 78,844 KB
実行使用メモリ 57,596 KB
最終ジャッジ日時 2023-10-24 21:29:33
合計ジャッジ時間 6,155 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
57,348 KB
testcase_01 AC 130 ms
57,492 KB
testcase_02 AC 131 ms
57,356 KB
testcase_03 AC 132 ms
57,356 KB
testcase_04 AC 131 ms
57,352 KB
testcase_05 WA -
testcase_06 AC 130 ms
57,448 KB
testcase_07 AC 131 ms
57,356 KB
testcase_08 AC 130 ms
57,336 KB
testcase_09 AC 132 ms
57,512 KB
testcase_10 AC 132 ms
57,532 KB
testcase_11 AC 130 ms
57,428 KB
testcase_12 AC 130 ms
57,380 KB
testcase_13 AC 129 ms
57,368 KB
testcase_14 AC 129 ms
57,496 KB
testcase_15 AC 131 ms
57,596 KB
testcase_16 AC 129 ms
57,332 KB
testcase_17 AC 130 ms
57,348 KB
testcase_18 AC 128 ms
57,404 KB
testcase_19 AC 130 ms
57,340 KB
testcase_20 AC 129 ms
57,440 KB
testcase_21 AC 128 ms
57,368 KB
testcase_22 AC 129 ms
55,384 KB
testcase_23 AC 129 ms
57,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class PocketAndBiscuits {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int cnt = 0;
		int biscuits = 1;
		while (true) {
			cnt++;
			if (biscuits * 2 >= n) {
				break;
			}
			biscuits += biscuits;
		}
		System.out.println(cnt);
	}
}
0