結果

問題 No.23 技の選択
ユーザー koba-e964
提出日時 2015-05-04 00:49:48
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 838 bytes
コンパイル時間 693 ms
コンパイル使用メモリ 85,948 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-28 16:46:59
合計ジャッジ時間 1,432 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)

using namespace std;
typedef long long int ll;
typedef vector<int> VI;
typedef pair<int, int> PI;
const double EPS=1e-9;



int main(void){
  int h,a,d;
  cin >> h >> a >> d;
  int m = 123456789;
  REP(i, 0, (h + 2 * a) / a) {
    int r = h - a * i;
    int td = max((r + d - 1) / d, 0);
    m = min(m, 2 * i + td * 3);
  }
  cout << m / 2.0 << endl;
  return 0;
}
0