結果

問題 No.23 技の選択
ユーザー scachescache
提出日時 2014-11-12 03:50:59
言語 Java21
(openjdk 21)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 611 bytes
コンパイル時間 2,070 ms
コンパイル使用メモリ 71,888 KB
実行使用メモリ 57,916 KB
最終ジャッジ日時 2023-08-30 03:16:35
合計ジャッジ時間 8,239 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
55,692 KB
testcase_01 AC 126 ms
55,968 KB
testcase_02 AC 127 ms
55,696 KB
testcase_03 AC 127 ms
55,864 KB
testcase_04 AC 127 ms
55,864 KB
testcase_05 AC 127 ms
55,848 KB
testcase_06 AC 129 ms
55,672 KB
testcase_07 AC 130 ms
55,796 KB
testcase_08 AC 128 ms
55,996 KB
testcase_09 AC 129 ms
55,600 KB
testcase_10 AC 126 ms
53,596 KB
testcase_11 AC 129 ms
55,908 KB
testcase_12 AC 128 ms
55,640 KB
testcase_13 AC 130 ms
55,780 KB
testcase_14 AC 127 ms
55,800 KB
testcase_15 WA -
testcase_16 AC 128 ms
55,676 KB
testcase_17 AC 126 ms
55,768 KB
testcase_18 WA -
testcase_19 AC 130 ms
55,392 KB
testcase_20 AC 127 ms
55,680 KB
testcase_21 AC 130 ms
55,852 KB
testcase_22 AC 127 ms
55,844 KB
testcase_23 AC 132 ms
55,428 KB
testcase_24 AC 130 ms
55,764 KB
testcase_25 AC 130 ms
55,656 KB
testcase_26 AC 127 ms
55,684 KB
testcase_27 AC 127 ms
56,000 KB
testcase_28 AC 129 ms
55,504 KB
testcase_29 AC 125 ms
55,972 KB
testcase_30 AC 129 ms
55,680 KB
testcase_31 AC 128 ms
55,628 KB
testcase_32 AC 129 ms
55,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
 
public class Main {
	public static void main(String[] args) {
		Main p = new Main();
	}
	double c, prob;
 
	public Main() {
		Scanner sc = new Scanner(System.in);
		int h = sc.nextInt();
		int a = sc.nextInt();
		int d = sc.nextInt();
 
		c = 1.0; prob = 0.0;
		for(int i=0;i<200;i++){
			prob += 1*c;
			c /= 3.0;
		}
 
		solve(h, a, d);
	}
 
	public void solve(int h, int a, int d) {
 
		double res = (h-1)/a+1;
		int m = (h-1)/a + 1;
		for(int i=0;i<=m;i++){
			res = Math.min(res, i+((h-i*a-1)/d+1)*prob);
		}
 
		System.out.println(res);
	}
 
}
0