結果

問題 No.23 技の選択
ユーザー 37zigen37zigen
提出日時 2016-03-25 17:21:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 130 ms / 5,000 ms
コード長 558 bytes
コンパイル時間 2,049 ms
コンパイル使用メモリ 71,656 KB
実行使用メモリ 57,508 KB
最終ジャッジ日時 2023-09-11 02:22:30
合計ジャッジ時間 7,639 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,800 KB
testcase_01 AC 125 ms
55,692 KB
testcase_02 AC 125 ms
56,048 KB
testcase_03 AC 127 ms
55,872 KB
testcase_04 AC 125 ms
55,824 KB
testcase_05 AC 126 ms
55,752 KB
testcase_06 AC 127 ms
55,444 KB
testcase_07 AC 125 ms
55,736 KB
testcase_08 AC 126 ms
55,972 KB
testcase_09 AC 129 ms
55,732 KB
testcase_10 AC 124 ms
55,740 KB
testcase_11 AC 124 ms
55,848 KB
testcase_12 AC 124 ms
55,756 KB
testcase_13 AC 124 ms
55,760 KB
testcase_14 AC 124 ms
57,508 KB
testcase_15 AC 126 ms
55,828 KB
testcase_16 AC 126 ms
55,960 KB
testcase_17 AC 123 ms
55,636 KB
testcase_18 AC 127 ms
55,676 KB
testcase_19 AC 124 ms
55,684 KB
testcase_20 AC 125 ms
55,508 KB
testcase_21 AC 127 ms
55,832 KB
testcase_22 AC 130 ms
55,752 KB
testcase_23 AC 127 ms
55,720 KB
testcase_24 AC 127 ms
55,696 KB
testcase_25 AC 126 ms
55,596 KB
testcase_26 AC 128 ms
55,684 KB
testcase_27 AC 128 ms
55,464 KB
testcase_28 AC 129 ms
55,832 KB
testcase_29 AC 127 ms
55,704 KB
testcase_30 AC 128 ms
55,744 KB
testcase_31 AC 127 ms
55,680 KB
testcase_32 AC 127 ms
55,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder023;
import java.util.Arrays;
import java.util.Scanner;
public class Main {
	static int h,a,d;
	static double[] memo=new double[100000];
	public static void main(String[] args){
		Arrays.fill(memo, -1);
		Scanner sc=new Scanner(System.in);
		h=sc.nextInt();//敵の体力
		a=sc.nextInt();//通常攻撃の威力
		d=sc.nextInt();//必殺技の威力
		
		System.out.println(dp(h));
		sc.close();
	}
	public static double dp(int x){
		if(x<=0)return 0;
		if(memo[x]>=0)return memo[x];
		return memo[x]=Math.min(dp(x-a)+1,dp(x-d)+1.5);
	}

}
0