結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー barrett114514barrett114514
提出日時 2017-07-23 21:16:17
言語 Java21
(openjdk 21)
結果
AC  
実行時間 117 ms / 5,000 ms
コード長 344 bytes
コンパイル時間 2,589 ms
コンパイル使用メモリ 74,112 KB
実行使用メモリ 54,376 KB
最終ジャッジ日時 2024-04-17 16:57:00
合計ジャッジ時間 5,721 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
52,948 KB
testcase_01 AC 102 ms
54,192 KB
testcase_02 AC 98 ms
53,140 KB
testcase_03 AC 106 ms
54,012 KB
testcase_04 AC 92 ms
52,756 KB
testcase_05 AC 106 ms
54,376 KB
testcase_06 AC 95 ms
53,072 KB
testcase_07 AC 102 ms
54,092 KB
testcase_08 AC 104 ms
54,004 KB
testcase_09 AC 104 ms
53,836 KB
testcase_10 AC 106 ms
53,884 KB
testcase_11 AC 92 ms
52,760 KB
testcase_12 AC 104 ms
53,736 KB
testcase_13 AC 104 ms
53,996 KB
testcase_14 AC 94 ms
52,824 KB
testcase_15 AC 108 ms
54,188 KB
testcase_16 AC 104 ms
54,152 KB
testcase_17 AC 106 ms
53,880 KB
testcase_18 AC 117 ms
53,996 KB
testcase_19 AC 97 ms
53,056 KB
testcase_20 AC 93 ms
52,992 KB
testcase_21 AC 101 ms
53,928 KB
testcase_22 AC 93 ms
52,744 KB
testcase_23 AC 109 ms
54,240 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;;) {

			
			if(biscuits >= N){
				System.out.println(i);
				break;
			}else{
				biscuits = biscuits * 2;
				 i++;
			}
		}
		

	}

}
0