結果

問題 No.555 世界史のレポート
ユーザー olpheolphe
提出日時 2017-08-11 23:10:32
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 847 bytes
コンパイル時間 918 ms
コンパイル使用メモリ 102,368 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-20 23:27:21
合計ジャッジ時間 1,504 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 2 ms
5,376 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "iomanip"
#include "random"

using namespace std;
const long long int MOD = 1000000007;
const long double EPS = 0.00000001;

long long int N, M, K, Q, W, H, L, R;
long long int ans;


int main() {
	ios::sync_with_stdio(false);
	cin >> N;
	cin >> K >> Q;
	ans = 1000000000;
	long long int box = 1;
	long long int bag = 1;
	for (int i = 1; i < 100; i++) {
		box = 1;
		long long int c = 0;
		for (int j = 1; j <= i; j++) {
			bag = box;
			box += bag;
			c += K + Q;
			if (box >= N) {
				break;
			}
		}
		if (box < N) {
			c += ((N - box) / bag + !!((N - box) % bag))*Q;
		}
		//cout << c << endl;
		ans = min(ans, c);
	}
	cout << ans << endl;
	return 0;
}
0