結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー shinwisteriashinwisteria
提出日時 2017-03-18 20:37:50
言語 Java21
(openjdk 21)
結果
AC  
実行時間 130 ms / 5,000 ms
コード長 320 bytes
コンパイル時間 5,196 ms
コンパイル使用メモリ 71,220 KB
実行使用メモリ 55,992 KB
最終ジャッジ日時 2023-09-18 02:47:59
合計ジャッジ時間 9,163 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,700 KB
testcase_01 AC 122 ms
55,952 KB
testcase_02 AC 126 ms
55,772 KB
testcase_03 AC 122 ms
55,612 KB
testcase_04 AC 121 ms
55,852 KB
testcase_05 AC 121 ms
55,608 KB
testcase_06 AC 122 ms
55,740 KB
testcase_07 AC 122 ms
55,992 KB
testcase_08 AC 121 ms
53,504 KB
testcase_09 AC 126 ms
55,408 KB
testcase_10 AC 122 ms
55,680 KB
testcase_11 AC 121 ms
55,692 KB
testcase_12 AC 122 ms
55,636 KB
testcase_13 AC 121 ms
55,584 KB
testcase_14 AC 124 ms
55,776 KB
testcase_15 AC 124 ms
55,376 KB
testcase_16 AC 122 ms
55,388 KB
testcase_17 AC 123 ms
55,792 KB
testcase_18 AC 122 ms
55,840 KB
testcase_19 AC 123 ms
55,928 KB
testcase_20 AC 123 ms
55,964 KB
testcase_21 AC 130 ms
55,836 KB
testcase_22 AC 124 ms
55,808 KB
testcase_23 AC 123 ms
55,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Biscket {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int N = s.nextInt(), count, num = 1;
		s.close();
		for(count = 0;num < N; count++){
			if(num * 2 <= N){
				num *= 2;
			}else{
				num = N;
			}
		}
		System.out.println(count);

	}

}
0