結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー aparachia14aparachia14
提出日時 2016-01-18 22:48:39
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 740 bytes
コンパイル時間 3,211 ms
コンパイル使用メモリ 74,348 KB
実行使用メモリ 53,428 KB
最終ジャッジ日時 2023-10-21 06:49:15
合計ジャッジ時間 5,650 ms
ジャッジサーバーID
(参考情報)
judge12 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
53,416 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 57 ms
53,420 KB
testcase_04 AC 55 ms
53,420 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 56 ms
53,384 KB
testcase_08 AC 55 ms
53,412 KB
testcase_09 AC 55 ms
53,424 KB
testcase_10 AC 56 ms
53,416 KB
testcase_11 AC 55 ms
53,412 KB
testcase_12 AC 55 ms
53,420 KB
testcase_13 AC 56 ms
53,416 KB
testcase_14 AC 56 ms
52,296 KB
testcase_15 AC 55 ms
52,344 KB
testcase_16 AC 56 ms
53,412 KB
testcase_17 AC 54 ms
53,416 KB
testcase_18 AC 55 ms
53,416 KB
testcase_19 AC 54 ms
52,292 KB
testcase_20 AC 56 ms
53,416 KB
testcase_21 AC 55 ms
53,424 KB
testcase_22 AC 56 ms
53,416 KB
testcase_23 AC 55 ms
53,428 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

//No.47 ポケットを叩くとビスケットが2倍
public class TwiceBiscuit {

	public static void main(String[] args) throws IOException {
		// TODO 自動生成されたメソッド・スタブ
		//食べたいビスケットの枚数
		int want;
		//ビスケットの枚数
		int biscuit = 1;
		//カウンタ
		int counter = 0;
		
		//入力受け取り
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		want = Integer.parseInt(in.readLine());
		
		while(true){
			biscuit = biscuit * 2;
			if(biscuit > want){
				break;
			}else{
				
			}
			counter++;
		}
		

		
		System.out.println(++counter);

	}

}
0