結果

問題 No.1010 折って重ねて
ユーザー ks2mks2m
提出日時 2020-03-20 21:33:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 57 ms / 2,000 ms
コード長 608 bytes
コンパイル時間 2,667 ms
コンパイル使用メモリ 74,736 KB
実行使用メモリ 37,344 KB
最終ジャッジ日時 2024-05-08 21:05:30
合計ジャッジ時間 6,206 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
37,208 KB
testcase_01 AC 55 ms
37,104 KB
testcase_02 AC 54 ms
36,840 KB
testcase_03 AC 53 ms
37,084 KB
testcase_04 AC 53 ms
36,512 KB
testcase_05 AC 51 ms
36,620 KB
testcase_06 AC 54 ms
36,964 KB
testcase_07 AC 52 ms
36,524 KB
testcase_08 AC 52 ms
37,104 KB
testcase_09 AC 52 ms
36,836 KB
testcase_10 AC 53 ms
36,816 KB
testcase_11 AC 54 ms
36,964 KB
testcase_12 AC 54 ms
37,044 KB
testcase_13 AC 54 ms
36,920 KB
testcase_14 AC 52 ms
37,128 KB
testcase_15 AC 53 ms
37,072 KB
testcase_16 AC 52 ms
36,984 KB
testcase_17 AC 53 ms
37,284 KB
testcase_18 AC 53 ms
36,828 KB
testcase_19 AC 52 ms
36,844 KB
testcase_20 AC 51 ms
36,840 KB
testcase_21 AC 54 ms
37,088 KB
testcase_22 AC 53 ms
37,124 KB
testcase_23 AC 54 ms
36,984 KB
testcase_24 AC 55 ms
37,344 KB
testcase_25 AC 55 ms
37,052 KB
testcase_26 AC 56 ms
36,944 KB
testcase_27 AC 55 ms
36,524 KB
testcase_28 AC 55 ms
37,084 KB
testcase_29 AC 55 ms
36,520 KB
testcase_30 AC 57 ms
37,100 KB
testcase_31 AC 55 ms
36,540 KB
testcase_32 AC 55 ms
37,000 KB
testcase_33 AC 55 ms
37,140 KB
testcase_34 AC 55 ms
36,852 KB
testcase_35 AC 55 ms
36,672 KB
testcase_36 AC 55 ms
37,076 KB
testcase_37 AC 55 ms
37,068 KB
testcase_38 AC 56 ms
36,672 KB
testcase_39 AC 55 ms
37,024 KB
testcase_40 AC 52 ms
37,344 KB
testcase_41 AC 55 ms
36,772 KB
testcase_42 AC 54 ms
37,100 KB
testcase_43 AC 55 ms
37,000 KB
testcase_44 AC 56 ms
37,088 KB
testcase_45 AC 53 ms
36,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] sa = br.readLine().split(" ");
		long x = Long.parseLong(sa[0]) * 1000;
		long y = Long.parseLong(sa[1]) * 1000;
		long h = Long.parseLong(sa[2]);
		br.close();

		double a = Math.min(x, y);
		double b = Math.max(x, y);
		long ans = 0;
		while (a > h) {
			a /= 2;
			h *= 2;
			ans++;
		}
		while (b > h) {
			b /= 2;
			h *= 2;
			ans++;
		}
		System.out.println(ans);
	}
}
0