結果

問題 No.23 技の選択
ユーザー 👑 CleyL
提出日時 2022-09-23 10:33:23
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 48 ms / 5,000 ms
コード長 332 bytes
コンパイル時間 788 ms
コンパイル使用メモリ 72,504 KB
最終ジャッジ日時 2025-02-07 13:49:44
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <iomanip>
using namespace std;
int main(){
  int h,a,d;cin>>h>>a>>d;
  int nw = 0;
  double ret = (h+a-1)/a;
  while(h >= 0){
    int count = (h+d-1)/d;
    double expect = (double)count*3/2;
    ret = min(ret,expect+nw);
    h -= a;
    nw++;
  }
  cout << fixed << setprecision(10) <<  ret << endl;
}
0