結果

問題 No.23 技の選択
ユーザー takana-sky07takana-sky07
提出日時 2019-08-31 22:03:56
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 698 bytes
コンパイル時間 718 ms
コンパイル使用メモリ 65,896 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-05-04 03:02:23
合計ジャッジ時間 2,477 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 WA -
testcase_10 RE -
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 RE -
testcase_14 AC 2 ms
5,376 KB
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 AC 2 ms
5,376 KB
testcase_21 RE -
testcase_22 AC 2 ms
5,376 KB
testcase_23 AC 2 ms
5,376 KB
testcase_24 AC 2 ms
5,376 KB
testcase_25 AC 2 ms
5,376 KB
testcase_26 AC 2 ms
5,376 KB
testcase_27 AC 1 ms
5,376 KB
testcase_28 AC 2 ms
5,376 KB
testcase_29 AC 2 ms
5,376 KB
testcase_30 AC 2 ms
6,948 KB
testcase_31 AC 2 ms
5,376 KB
testcase_32 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/*
* 023_sample.cpp
* 
* No.23 Z̑I
* Փx3
*/

#include <iostream>
#include <cstdio>

static const int INF = 1e9+7;

int main () {
	// W
	int H = 0;		// GHP
	int A = 0;		// ʏUŗ^_[W
	int D = 0;		// KEZŗ^_[W
	std::cin >> H >> A >> D;

	// dp[G̎cHP]=G|̂ɂŏU
	double dp[H+D];
	for (int i = 0; i < H+1; i++) {
		dp[i] = 0;
	}

	for (int i = H-1; 0 <= i; --i) {
		// cHP̑U񐔂ƍU񐔂𑫂
		// 菭ȂU񐔂߂
		dp[i] = std::min(dp[i+A] + 1.0, dp[i+D] + 1.5);
	}

	// dp[0](cHP0)̂Ƃ̊Ғl
	std::cout << dp[0] << std::endl;

	return 0;
	
}
0