結果

問題 No.23 技の選択
ユーザー GrenacheGrenache
提出日時 2016-03-12 11:20:29
言語 Java21
(openjdk 21)
結果
AC  
実行時間 137 ms / 5,000 ms
コード長 516 bytes
コンパイル時間 3,892 ms
コンパイル使用メモリ 72,368 KB
実行使用メモリ 57,820 KB
最終ジャッジ日時 2023-09-11 02:22:10
合計ジャッジ時間 9,927 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
56,036 KB
testcase_01 AC 132 ms
57,820 KB
testcase_02 AC 132 ms
55,980 KB
testcase_03 AC 132 ms
55,920 KB
testcase_04 AC 133 ms
55,828 KB
testcase_05 AC 136 ms
55,824 KB
testcase_06 AC 133 ms
55,840 KB
testcase_07 AC 137 ms
55,568 KB
testcase_08 AC 132 ms
55,612 KB
testcase_09 AC 130 ms
56,184 KB
testcase_10 AC 132 ms
55,988 KB
testcase_11 AC 131 ms
55,932 KB
testcase_12 AC 131 ms
55,808 KB
testcase_13 AC 131 ms
55,864 KB
testcase_14 AC 132 ms
55,760 KB
testcase_15 AC 135 ms
55,996 KB
testcase_16 AC 129 ms
53,768 KB
testcase_17 AC 132 ms
55,736 KB
testcase_18 AC 131 ms
55,836 KB
testcase_19 AC 132 ms
56,100 KB
testcase_20 AC 130 ms
55,612 KB
testcase_21 AC 130 ms
55,708 KB
testcase_22 AC 133 ms
56,016 KB
testcase_23 AC 130 ms
55,700 KB
testcase_24 AC 130 ms
55,520 KB
testcase_25 AC 133 ms
55,708 KB
testcase_26 AC 131 ms
55,704 KB
testcase_27 AC 132 ms
55,936 KB
testcase_28 AC 133 ms
55,820 KB
testcase_29 AC 132 ms
55,764 KB
testcase_30 AC 133 ms
55,608 KB
testcase_31 AC 132 ms
55,836 KB
testcase_32 AC 134 ms
55,732 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main_yukicoder23 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int h = sc.nextInt();
        int a = sc.nextInt();
        int d = sc.nextInt();

        double[] e = new double[h + 1];
        e[0] = 0;

        for (int i = 1; i <= h; i++) {
        	e[i] = Math.min(1 + e[Math.max(0, i - a)], (double)3 / 2 + e[Math.max(0, i - d)]);
        }

        System.out.printf("%.3f\n", e[h]);

        sc.close();
    }
}
0