結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー barrett114514barrett114514
提出日時 2017-07-23 21:11:40
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 331 bytes
コンパイル時間 3,067 ms
コンパイル使用メモリ 77,256 KB
実行使用メモリ 54,452 KB
最終ジャッジ日時 2024-04-17 16:56:37
合計ジャッジ時間 6,643 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
53,812 KB
testcase_01 AC 122 ms
54,040 KB
testcase_02 AC 108 ms
53,008 KB
testcase_03 AC 122 ms
54,080 KB
testcase_04 AC 109 ms
53,032 KB
testcase_05 WA -
testcase_06 AC 107 ms
52,868 KB
testcase_07 AC 119 ms
54,256 KB
testcase_08 AC 121 ms
54,304 KB
testcase_09 AC 113 ms
54,452 KB
testcase_10 AC 123 ms
54,244 KB
testcase_11 AC 112 ms
52,952 KB
testcase_12 AC 107 ms
52,736 KB
testcase_13 AC 122 ms
53,960 KB
testcase_14 AC 117 ms
54,124 KB
testcase_15 AC 113 ms
53,724 KB
testcase_16 AC 109 ms
52,840 KB
testcase_17 AC 123 ms
54,052 KB
testcase_18 AC 120 ms
53,980 KB
testcase_19 AC 122 ms
54,224 KB
testcase_20 AC 122 ms
54,384 KB
testcase_21 AC 124 ms
53,836 KB
testcase_22 AC 123 ms
54,272 KB
testcase_23 AC 124 ms
54,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class BiscuitsBeDoubled {

	public static void main(String[] args) {

		int biscuits = 1;

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();

		for (int i = 0; biscuits <N;) {
			biscuits = biscuits * 2;
			 i++;
			
			if(biscuits >= N){
				System.out.println(i);
			}
		}
		

	}

}
0