結果

問題 No.23 技の選択
ユーザー SSRS
提出日時 2020-11-08 23:56:39
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 279 bytes
コンパイル時間 1,432 ms
コンパイル使用メモリ 165,864 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-22 15:47:53
合計ジャッジ時間 2,386 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
const int INF = 100000;
int main(){
  int H, A, D;
  cin >> H >> A >> D;
  double ans = (H + A - 1) / A;
  for (int i = 0; i < (H + A - 1) / A; i++){
    ans = min(ans, i + (H - A * i + D - 1) / D * 1.5);
  }
  cout << ans << endl;
}
0