結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー t8m8⛄️t8m8⛄️
提出日時 2015-04-03 06:00:23
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 5,000 ms
コード長 825 bytes
コンパイル時間 3,273 ms
コンパイル使用メモリ 72,636 KB
実行使用メモリ 56,420 KB
最終ジャッジ日時 2023-09-17 03:56:12
合計ジャッジ時間 7,384 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,428 KB
testcase_01 AC 124 ms
56,104 KB
testcase_02 AC 125 ms
56,348 KB
testcase_03 AC 126 ms
56,108 KB
testcase_04 AC 126 ms
55,860 KB
testcase_05 AC 126 ms
55,952 KB
testcase_06 AC 125 ms
55,584 KB
testcase_07 AC 126 ms
55,924 KB
testcase_08 AC 125 ms
56,384 KB
testcase_09 AC 125 ms
55,832 KB
testcase_10 AC 127 ms
56,064 KB
testcase_11 AC 125 ms
56,080 KB
testcase_12 AC 126 ms
55,956 KB
testcase_13 AC 125 ms
55,856 KB
testcase_14 AC 125 ms
56,236 KB
testcase_15 AC 125 ms
56,204 KB
testcase_16 AC 125 ms
55,500 KB
testcase_17 AC 125 ms
56,164 KB
testcase_18 AC 125 ms
56,068 KB
testcase_19 AC 124 ms
55,752 KB
testcase_20 AC 126 ms
56,420 KB
testcase_21 AC 125 ms
56,324 KB
testcase_22 AC 126 ms
56,196 KB
testcase_23 AC 126 ms
55,656 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

import java.util.*;
import java.io.*;
import static java.util.Arrays.*;
import static java.lang.Math.*;

public class No47 {
    
    static final Scanner sc = new Scanner(System.in);
    static final PrintWriter out = new PrintWriter(System.out,false);

    static void solve() {
        double n = sc.nextInt();
        int cnt = 0;
        while (n > 1) {
            n = ceil(n/2);
            cnt++;
        }
        out.println(cnt);
    }

    public static void main(String[] args) {
        long start = System.currentTimeMillis();

        solve();
        out.flush();

        long end = System.currentTimeMillis();
        //trace(end-start + "ms");
        sc.close();
    }

    static void trace(Object... o) { System.out.println(deepToString(o));}
}
0