結果

問題 No.1010 折って重ねて
ユーザー Mishan5055Mishan5055
提出日時 2020-03-27 16:51:37
言語 Java21
(openjdk 21)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 673 bytes
コンパイル時間 1,969 ms
コンパイル使用メモリ 70,792 KB
実行使用メモリ 56,660 KB
最終ジャッジ日時 2023-08-30 16:30:05
合計ジャッジ時間 9,316 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
56,168 KB
testcase_01 AC 124 ms
56,060 KB
testcase_02 AC 129 ms
56,136 KB
testcase_03 AC 123 ms
56,228 KB
testcase_04 AC 129 ms
56,228 KB
testcase_05 AC 127 ms
56,164 KB
testcase_06 AC 125 ms
56,164 KB
testcase_07 AC 123 ms
56,352 KB
testcase_08 AC 126 ms
56,268 KB
testcase_09 AC 137 ms
56,324 KB
testcase_10 AC 126 ms
55,816 KB
testcase_11 AC 127 ms
55,900 KB
testcase_12 AC 123 ms
55,528 KB
testcase_13 AC 127 ms
56,440 KB
testcase_14 AC 128 ms
55,748 KB
testcase_15 AC 125 ms
56,088 KB
testcase_16 AC 123 ms
55,732 KB
testcase_17 AC 125 ms
56,200 KB
testcase_18 AC 126 ms
56,036 KB
testcase_19 AC 138 ms
56,244 KB
testcase_20 AC 128 ms
56,284 KB
testcase_21 AC 137 ms
55,804 KB
testcase_22 AC 130 ms
56,228 KB
testcase_23 AC 127 ms
56,076 KB
testcase_24 AC 124 ms
55,528 KB
testcase_25 AC 128 ms
55,748 KB
testcase_26 AC 126 ms
55,876 KB
testcase_27 AC 125 ms
55,856 KB
testcase_28 AC 125 ms
56,268 KB
testcase_29 AC 124 ms
55,892 KB
testcase_30 AC 124 ms
56,384 KB
testcase_31 AC 125 ms
55,900 KB
testcase_32 AC 127 ms
56,172 KB
testcase_33 AC 121 ms
56,072 KB
testcase_34 AC 124 ms
55,864 KB
testcase_35 AC 122 ms
56,452 KB
testcase_36 AC 122 ms
56,092 KB
testcase_37 AC 123 ms
56,236 KB
testcase_38 AC 127 ms
55,828 KB
testcase_39 AC 125 ms
56,104 KB
testcase_40 AC 125 ms
56,244 KB
testcase_41 AC 126 ms
56,116 KB
testcase_42 AC 127 ms
55,752 KB
testcase_43 AC 128 ms
55,536 KB
testcase_44 AC 122 ms
56,588 KB
testcase_45 AC 129 ms
56,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc=new Scanner(System.in);
        double X=sc.nextDouble();
        double Y=sc.nextDouble();
        double H=sc.nextDouble();
        
        X*=1000;
        Y*=1000;
        
        if(X<Y){// X,Y must be X>Y
            double tmp=X;
            X=Y;
            Y=tmp;
        }
        
        int ans=0;
        
        while(Y>H){
            ans++;
            Y/=2;
            H*=2;
        }
        
        while(X>H){
            ans++;
            X/=2;
            H*=2;
        }
        
        System.out.println(ans);
    }
}
0