結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー shinshin
提出日時 2022-05-17 07:28:16
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 757 bytes
コンパイル時間 5,199 ms
コンパイル使用メモリ 72,632 KB
実行使用メモリ 49,904 KB
最終ジャッジ日時 2023-10-13 03:18:17
合計ジャッジ時間 6,395 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,548 KB
testcase_01 AC 43 ms
49,436 KB
testcase_02 AC 43 ms
49,652 KB
testcase_03 AC 43 ms
49,388 KB
testcase_04 AC 44 ms
49,156 KB
testcase_05 WA -
testcase_06 AC 43 ms
49,408 KB
testcase_07 AC 44 ms
49,416 KB
testcase_08 AC 44 ms
49,396 KB
testcase_09 AC 43 ms
49,428 KB
testcase_10 AC 43 ms
49,684 KB
testcase_11 AC 43 ms
49,904 KB
testcase_12 AC 43 ms
49,296 KB
testcase_13 AC 42 ms
49,252 KB
testcase_14 AC 44 ms
49,548 KB
testcase_15 AC 43 ms
49,276 KB
testcase_16 AC 43 ms
49,284 KB
testcase_17 AC 43 ms
49,256 KB
testcase_18 AC 43 ms
49,368 KB
testcase_19 AC 43 ms
49,416 KB
testcase_20 AC 43 ms
49,200 KB
testcase_21 AC 43 ms
49,324 KB
testcase_22 AC 42 ms
49,252 KB
testcase_23 AC 43 ms
49,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class No47 {

	public static void main(String[] args) throws IOException{
		//ポケットを叩くとビスケットが2倍
		int N = Integer.parseInt(readStr()[0]) , s = 1 , count = 0;
		do {
			s = Math.min(s * 2, N);
			count += 1;
		}while(s < N);
		
		System.out.println(count);

	}
	
	public static String[] readStr() throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<String> list = new ArrayList<>();

		do {
			list.add(br.readLine());
		}while(br.ready());

		br.close();

		String[] text = new String[list.size()];
		list.toArray(text);

		return text;

	}

}
0