結果
| 問題 |
No.23 技の選択
|
| コンテスト | |
| ユーザー |
hiromi_ayase
|
| 提出日時 | 2015-12-07 22:42:19 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 138 ms / 5,000 ms |
| コード長 | 562 bytes |
| コンパイル時間 | 3,742 ms |
| コンパイル使用メモリ | 74,392 KB |
| 実行使用メモリ | 41,536 KB |
| 最終ジャッジ日時 | 2024-06-28 16:49:59 |
| 合計ジャッジ時間 | 9,079 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 33 |
ソースコード
import java.util.Scanner;
public class Main2 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int H = scanner.nextInt();
int A = scanner.nextInt();
int D = scanner.nextInt();
double[] dp = new double[H + 1];
for (int i = 1; i <= H; i ++) {
if (i <= A) {
dp[i] = 1;
} else {
dp[i] = Math.min(dp[i - A] + 1, dp[Math.max(i - D, 0)] + 3.0 / 2);
}
}
System.out.println(dp[H]);
}
}
hiromi_ayase