結果

問題 No.23 技の選択
ユーザー togatogatogatoga
提出日時 2015-04-07 12:10:21
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 767 bytes
コンパイル時間 1,457 ms
コンパイル使用メモリ 144,640 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-17 06:36:24
合計ジャッジ時間 3,122 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

#define mp make_pair
#define mt make_tuple
#define pb push_back
#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<long, long> pll;

const int INF = 1 << 29;
const double EPS = 1e-9;
const int MOD = 100000007;

const int dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
int H,A,D;
double dp[100100];
int main() {
  cin >> H >> A >> D;
  fill(dp, dp + 100100, INF);
  dp[0] = 0;
  for (int i = 1; i <= H; i++){
    if (i - A >= 0 && dp[i - A] != INF){
      dp[i] = min(dp[i], dp[i - A] + 1);
    }
    if (i - D >= 0 && dp[i - D] != INF){
      dp[i] = min(dp[i], dp[i - D] + 1.5);
    }
  }
  cout << dp[H] << endl;
  return 0;
}
0