結果
問題 | No.23 技の選択 |
ユーザー |
![]() |
提出日時 | 2015-07-20 18:22:50 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 695 bytes |
コンパイル時間 | 492 ms |
コンパイル使用メモリ | 80,612 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-28 16:47:26 |
合計ジャッジ時間 | 1,289 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 33 |
ソースコード
#include<sstream> #include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<string> #include<vector> #include<set> #include<map> #include<queue> #include<numeric> #include<functional> #include<algorithm> #include<bitset> using namespace std; #define INF (1<<29) #define rep(i,n) for(int i=0;i<(int)(n);i++) #define all(v) v.begin(),v.end() #define uniq(v) v.erase(unique(all(v)),v.end()) #define indexOf(v,x) (find(all(v),x)-v.begin()) int main(){ int h,a,d; cin>>h>>a>>d; double ans=h; rep(i,h){ int rem=max(0,h-i*a); int nd=(rem+d-1)/d; double e=i+nd*1.0/(2.0/3.0); ans=min(ans,e); if(h<i*a)break; } printf("%.2f\n",ans); return 0; }