結果

問題 No.23 技の選択
コンテスト
ユーザー kenken714
提出日時 2019-04-19 18:56:10
言語 C++11
(gcc 15.3.0 + boost 1.92.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 5,000 ms
+ 335µs
コード長 888 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 481 ms
コンパイル使用メモリ 104,264 KB
実行使用メモリ 9,932 KB
最終ジャッジ日時 2026-09-02 11:10:09
合計ジャッジ時間 2,397 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <queue>
#include <stack>
#include <iomanip>

using namespace std;

#define REP(i, n) for(ll i = 0;i < n;i++)
#define REPR(i, n) for(ll i = n;i >= 0;i--)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
#define FORR(i, m, n) for(ll i = m;i >= n;i--)
#define REPO(i, n) for(ll i = 1;i <= n;i++)
#define ll long long
#define INF (ll)1 << 60
#define MINF (-1 * INF)
#define ALL(n) n.begin(),n.end()
#define MOD 1000000007
#define P pair<ll, ll>


ll a, b, c;
double ans = 1e9;
int main() {
	cin >> a >> b >> c;
	REP(i, INF) {
		if (i * b >= a) {
			ans = min(ans, (double)i);
			break;
		}
		ll now = (a - i * b + c - 1) / c;
		double nd = (double)now / 2 * 3;
		ans = min(ans, i + nd);
	}
	cout << fixed << ans << endl;
}


0