結果

問題 No.1010 折って重ねて
ユーザー ntk3264ntk3264
提出日時 2020-04-03 02:29:18
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 808 bytes
コンパイル時間 2,155 ms
コンパイル使用メモリ 72,320 KB
実行使用メモリ 57,272 KB
最終ジャッジ日時 2023-09-11 03:06:04
合計ジャッジ時間 9,985 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
55,600 KB
testcase_01 AC 127 ms
55,700 KB
testcase_02 AC 129 ms
55,308 KB
testcase_03 AC 129 ms
55,764 KB
testcase_04 AC 130 ms
53,868 KB
testcase_05 AC 126 ms
55,684 KB
testcase_06 AC 128 ms
55,568 KB
testcase_07 AC 128 ms
55,648 KB
testcase_08 AC 127 ms
55,640 KB
testcase_09 AC 127 ms
55,916 KB
testcase_10 AC 129 ms
55,876 KB
testcase_11 AC 129 ms
55,804 KB
testcase_12 AC 129 ms
55,696 KB
testcase_13 AC 129 ms
55,928 KB
testcase_14 AC 129 ms
55,588 KB
testcase_15 AC 130 ms
55,632 KB
testcase_16 AC 130 ms
55,332 KB
testcase_17 AC 131 ms
55,544 KB
testcase_18 AC 129 ms
55,684 KB
testcase_19 AC 129 ms
55,832 KB
testcase_20 AC 128 ms
55,448 KB
testcase_21 AC 129 ms
55,864 KB
testcase_22 AC 133 ms
55,584 KB
testcase_23 AC 128 ms
55,520 KB
testcase_24 AC 131 ms
55,864 KB
testcase_25 AC 129 ms
55,728 KB
testcase_26 AC 129 ms
56,248 KB
testcase_27 AC 128 ms
55,280 KB
testcase_28 AC 128 ms
55,636 KB
testcase_29 AC 128 ms
53,912 KB
testcase_30 AC 128 ms
55,604 KB
testcase_31 AC 129 ms
55,640 KB
testcase_32 AC 128 ms
55,624 KB
testcase_33 AC 128 ms
55,700 KB
testcase_34 AC 128 ms
55,680 KB
testcase_35 AC 129 ms
55,580 KB
testcase_36 AC 129 ms
56,004 KB
testcase_37 AC 128 ms
55,712 KB
testcase_38 WA -
testcase_39 AC 127 ms
55,320 KB
testcase_40 WA -
testcase_41 AC 127 ms
55,632 KB
testcase_42 AC 127 ms
55,524 KB
testcase_43 AC 127 ms
55,616 KB
testcase_44 AC 127 ms
55,628 KB
testcase_45 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.PrintWriter;
import java.util.*;

public class Main {

    Scanner sc = new Scanner(System.in);

    PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {

        long x = sc.nextLong()*1000;
        long y = sc.nextLong()*1000;
        long h = sc.nextLong();

        int ans = 0;

        while (x>h || y>h) {
            if (y<x) {
                long tmp = y;
                y = x;
                x = tmp;
            }
            if (x>h) {
                x /= 2;
                h *= 2;
                ans++;
            } else if (y>h) {
                y /= 2;
                h *= 2;
                ans++;
            }
        }

        out.print(ans);
        out.flush();

    }

}
0