結果

問題 No.23 技の選択
ユーザー kou6839kou6839
提出日時 2014-11-22 18:41:55
言語 Java19
(openjdk 21)
結果
AC  
実行時間 124 ms / 5,000 ms
コード長 437 bytes
コンパイル時間 3,485 ms
コンパイル使用メモリ 71,196 KB
実行使用メモリ 52,284 KB
最終ジャッジ日時 2023-09-11 02:15:06
合計ジャッジ時間 8,984 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
39,760 KB
testcase_01 AC 123 ms
39,880 KB
testcase_02 AC 120 ms
40,060 KB
testcase_03 AC 120 ms
39,668 KB
testcase_04 AC 121 ms
39,796 KB
testcase_05 AC 122 ms
40,160 KB
testcase_06 AC 118 ms
39,484 KB
testcase_07 AC 120 ms
39,740 KB
testcase_08 AC 121 ms
39,964 KB
testcase_09 AC 121 ms
39,644 KB
testcase_10 AC 119 ms
39,876 KB
testcase_11 AC 117 ms
39,824 KB
testcase_12 AC 117 ms
39,592 KB
testcase_13 AC 117 ms
39,632 KB
testcase_14 AC 118 ms
40,196 KB
testcase_15 AC 118 ms
40,088 KB
testcase_16 AC 117 ms
39,492 KB
testcase_17 AC 118 ms
39,600 KB
testcase_18 AC 121 ms
39,744 KB
testcase_19 AC 120 ms
39,628 KB
testcase_20 AC 118 ms
40,056 KB
testcase_21 AC 118 ms
39,712 KB
testcase_22 AC 120 ms
39,916 KB
testcase_23 AC 119 ms
39,624 KB
testcase_24 AC 120 ms
39,572 KB
testcase_25 AC 124 ms
52,284 KB
testcase_26 AC 121 ms
39,552 KB
testcase_27 AC 120 ms
39,396 KB
testcase_28 AC 119 ms
40,192 KB
testcase_29 AC 122 ms
39,412 KB
testcase_30 AC 121 ms
39,772 KB
testcase_31 AC 121 ms
40,048 KB
testcase_32 AC 119 ms
39,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
 

public class Main {

	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 [] dp = new double[20001];
		Arrays.fill(dp,0,10000,0);
		Arrays.fill(dp, 10001,20000,999999);
		for(int i=10001;i<20001;i++){
			dp[i]=Math.min(1+dp[i-a], 1.5+dp[i-d]);
		}
		System.out.println(dp[10000+h]);
	}
}
0