結果

問題 No.1010 折って重ねて
ユーザー htensaihtensai
提出日時 2020-03-25 10:26:46
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 556 bytes
コンパイル時間 2,134 ms
コンパイル使用メモリ 71,408 KB
実行使用メモリ 56,124 KB
最終ジャッジ日時 2023-08-30 09:28:18
合計ジャッジ時間 10,298 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,692 KB
testcase_01 AC 124 ms
55,692 KB
testcase_02 AC 125 ms
55,996 KB
testcase_03 AC 124 ms
55,796 KB
testcase_04 AC 125 ms
55,764 KB
testcase_05 AC 125 ms
55,668 KB
testcase_06 AC 121 ms
55,692 KB
testcase_07 AC 124 ms
55,828 KB
testcase_08 AC 121 ms
55,444 KB
testcase_09 AC 125 ms
55,632 KB
testcase_10 AC 121 ms
55,576 KB
testcase_11 AC 124 ms
55,460 KB
testcase_12 AC 122 ms
55,516 KB
testcase_13 AC 122 ms
55,608 KB
testcase_14 AC 123 ms
55,476 KB
testcase_15 AC 125 ms
55,700 KB
testcase_16 AC 123 ms
55,544 KB
testcase_17 AC 123 ms
55,652 KB
testcase_18 AC 128 ms
53,980 KB
testcase_19 AC 125 ms
55,820 KB
testcase_20 AC 126 ms
55,772 KB
testcase_21 AC 125 ms
55,596 KB
testcase_22 AC 123 ms
56,124 KB
testcase_23 AC 123 ms
55,508 KB
testcase_24 AC 123 ms
55,304 KB
testcase_25 AC 124 ms
55,620 KB
testcase_26 AC 123 ms
55,552 KB
testcase_27 AC 123 ms
55,924 KB
testcase_28 AC 124 ms
55,872 KB
testcase_29 AC 124 ms
55,632 KB
testcase_30 AC 123 ms
55,764 KB
testcase_31 AC 122 ms
55,568 KB
testcase_32 AC 122 ms
55,548 KB
testcase_33 AC 122 ms
55,656 KB
testcase_34 AC 122 ms
55,832 KB
testcase_35 AC 122 ms
53,820 KB
testcase_36 AC 124 ms
55,672 KB
testcase_37 AC 123 ms
55,668 KB
testcase_38 AC 123 ms
55,852 KB
testcase_39 AC 123 ms
55,536 KB
testcase_40 AC 122 ms
55,804 KB
testcase_41 AC 123 ms
55,828 KB
testcase_42 AC 123 ms
55,652 KB
testcase_43 AC 122 ms
55,788 KB
testcase_44 AC 126 ms
55,544 KB
testcase_45 AC 127 ms
55,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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