結果

問題 No.23 技の選択
ユーザー htensaihtensai
提出日時 2020-02-10 15:52:20
言語 Java21
(openjdk 21)
結果
AC  
実行時間 148 ms / 5,000 ms
コード長 567 bytes
コンパイル時間 2,675 ms
コンパイル使用メモリ 78,840 KB
実行使用メモリ 58,324 KB
最終ジャッジ日時 2024-04-08 13:02:30
合計ジャッジ時間 8,880 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 143 ms
57,684 KB
testcase_01 AC 143 ms
57,824 KB
testcase_02 AC 141 ms
57,824 KB
testcase_03 AC 140 ms
58,324 KB
testcase_04 AC 143 ms
57,824 KB
testcase_05 AC 140 ms
58,076 KB
testcase_06 AC 139 ms
57,984 KB
testcase_07 AC 140 ms
57,948 KB
testcase_08 AC 143 ms
57,984 KB
testcase_09 AC 142 ms
58,080 KB
testcase_10 AC 137 ms
58,080 KB
testcase_11 AC 138 ms
58,216 KB
testcase_12 AC 136 ms
58,060 KB
testcase_13 AC 141 ms
56,412 KB
testcase_14 AC 142 ms
57,856 KB
testcase_15 AC 144 ms
58,184 KB
testcase_16 AC 139 ms
57,824 KB
testcase_17 AC 139 ms
57,680 KB
testcase_18 AC 142 ms
57,996 KB
testcase_19 AC 141 ms
58,080 KB
testcase_20 AC 144 ms
57,708 KB
testcase_21 AC 142 ms
56,256 KB
testcase_22 AC 142 ms
57,816 KB
testcase_23 AC 144 ms
57,692 KB
testcase_24 AC 141 ms
57,704 KB
testcase_25 AC 148 ms
57,968 KB
testcase_26 AC 145 ms
57,728 KB
testcase_27 AC 144 ms
57,728 KB
testcase_28 AC 139 ms
57,676 KB
testcase_29 AC 142 ms
57,684 KB
testcase_30 AC 144 ms
57,704 KB
testcase_31 AC 143 ms
58,064 KB
testcase_32 AC 146 ms
56,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    static double[] dp;
    static int a;
    static int d;
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int h = sc.nextInt();
		a = sc.nextInt();
		d = sc.nextInt();
		dp = new double[h + 1];
		System.out.println(dfw(h));
   }
   static double dfw(int power) {
       if (power <= 0) {
           return 0;
       }
       if (dp[power] != 0) {
           return dp[power];
       }
       dp[power] = Math.min(dfw(power - a) + 1, dfw(power - d) + 1.5);
       return dp[power];
   }
}
0