結果

問題 No.1010 折って重ねて
ユーザー tentententen
提出日時 2020-12-01 10:05:01
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 719 bytes
コンパイル時間 1,971 ms
コンパイル使用メモリ 71,356 KB
実行使用メモリ 56,532 KB
最終ジャッジ日時 2023-10-11 03:25:08
合計ジャッジ時間 10,198 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,980 KB
testcase_01 AC 124 ms
55,608 KB
testcase_02 AC 122 ms
55,728 KB
testcase_03 AC 122 ms
55,432 KB
testcase_04 AC 124 ms
55,896 KB
testcase_05 AC 124 ms
55,808 KB
testcase_06 AC 123 ms
55,844 KB
testcase_07 AC 122 ms
56,148 KB
testcase_08 AC 123 ms
55,856 KB
testcase_09 AC 123 ms
55,732 KB
testcase_10 AC 122 ms
55,548 KB
testcase_11 AC 123 ms
55,724 KB
testcase_12 AC 127 ms
55,708 KB
testcase_13 AC 123 ms
56,112 KB
testcase_14 AC 122 ms
55,536 KB
testcase_15 AC 122 ms
56,016 KB
testcase_16 AC 123 ms
55,676 KB
testcase_17 AC 124 ms
55,680 KB
testcase_18 AC 124 ms
56,140 KB
testcase_19 AC 124 ms
56,120 KB
testcase_20 AC 125 ms
55,892 KB
testcase_21 AC 128 ms
56,076 KB
testcase_22 AC 125 ms
55,776 KB
testcase_23 AC 124 ms
55,624 KB
testcase_24 AC 121 ms
55,432 KB
testcase_25 AC 122 ms
55,836 KB
testcase_26 AC 123 ms
55,756 KB
testcase_27 AC 124 ms
55,528 KB
testcase_28 AC 122 ms
56,168 KB
testcase_29 AC 121 ms
55,928 KB
testcase_30 AC 125 ms
55,940 KB
testcase_31 AC 124 ms
56,084 KB
testcase_32 AC 123 ms
55,872 KB
testcase_33 AC 123 ms
55,588 KB
testcase_34 AC 120 ms
55,748 KB
testcase_35 AC 120 ms
55,668 KB
testcase_36 AC 120 ms
55,760 KB
testcase_37 AC 120 ms
55,428 KB
testcase_38 AC 123 ms
56,532 KB
testcase_39 AC 122 ms
55,932 KB
testcase_40 AC 120 ms
55,732 KB
testcase_41 AC 122 ms
55,680 KB
testcase_42 AC 123 ms
55,960 KB
testcase_43 AC 123 ms
56,248 KB
testcase_44 AC 120 ms
56,088 KB
testcase_45 AC 120 ms
55,832 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double x = sc.nextInt() * 1000L;
        double y = sc.nextInt() * 1000L;
        double h = sc.nextInt();
        int count = 0;
        while (true) {
            if (x < y && x > h) {
                count++;
                x /= 2;
                h *= 2;
            } else if (y > h) {
                count++;
                y /= 2;
                h *= 2;
            } else if (x > h) {
                count++;
                x /= 2;
                h *= 2;
            } else {
                break;
            }
        }
        System.out.println(count);
    }
}
0