結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-12 22:05:34
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 5,000 ms
コード長 278 bytes
コンパイル時間 2,136 ms
コンパイル使用メモリ 73,868 KB
実行使用メモリ 54,348 KB
最終ジャッジ日時 2024-05-04 04:46:50
合計ジャッジ時間 5,447 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
53,812 KB
testcase_01 AC 108 ms
52,812 KB
testcase_02 AC 108 ms
54,012 KB
testcase_03 AC 99 ms
52,896 KB
testcase_04 AC 100 ms
52,972 KB
testcase_05 AC 97 ms
52,832 KB
testcase_06 AC 109 ms
54,348 KB
testcase_07 AC 101 ms
53,068 KB
testcase_08 AC 117 ms
54,088 KB
testcase_09 AC 106 ms
53,056 KB
testcase_10 AC 114 ms
54,284 KB
testcase_11 AC 101 ms
53,028 KB
testcase_12 AC 123 ms
54,096 KB
testcase_13 AC 121 ms
54,200 KB
testcase_14 AC 111 ms
53,832 KB
testcase_15 AC 113 ms
54,192 KB
testcase_16 AC 118 ms
53,832 KB
testcase_17 AC 118 ms
54,108 KB
testcase_18 AC 121 ms
53,992 KB
testcase_19 AC 118 ms
54,084 KB
testcase_20 AC 119 ms
54,012 KB
testcase_21 AC 103 ms
53,044 KB
testcase_22 AC 101 ms
52,936 KB
testcase_23 AC 102 ms
54,108 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int n = sc.nextInt();
		int biscuit = 1;
		int times = 0;
		while (biscuit < n) {
			biscuit *= 2;
			times++;
		}
		System.out.println(times);
	}
}
0