結果
| 問題 |
No.23 技の選択
|
| コンテスト | |
| ユーザー |
togari_takamoto
|
| 提出日時 | 2016-02-25 21:51:56 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 915 bytes |
| コンパイル時間 | 1,383 ms |
| コンパイル使用メモリ | 159,340 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-28 16:50:46 |
| 合計ジャッジ時間 | 2,317 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 33 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>; using vb = vector<bool>; using vd = vector<double>; using vl = vector<ll>;
using vvi = vector<vi>; using vvb = vector<vb>; using vvd = vector<vd>; using vvl = vector<vl>;
#define REP(i,n) for(ll i=0; i<(n); ++i)
#define FOR(i,b,n) for(ll i=(b); i<(n); ++i)
#define ALL(v) (v).begin(), (v).end()
#define TEN(x) ((ll)1e##x)
int main() {
// cin.tie(0);
// ios_base::sync_with_stdio(false);
cout << fixed << setprecision(5);
ll h, a, d;
cin >> h >> a >> d;
vd expect(TEN(4)*2 + 1, TEN(4) * 2+1); expect[0] = 0;
REP(i, expect.size()) {
if (i + a < expect.size()) expect[i + a] = min(expect[i + a], expect[i] + 1);
if (i + d < expect.size()) expect[i + d] = min(expect[i + d], expect[i] + 1.5);
}
double v = TEN(4)*2+1;
FOR(i, h, expect.size()) v = min(v, expect[i]);
cout << v << endl;
return 0;
}
togari_takamoto