結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 WA -
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 WA -
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 454 ms
5,376 KB
testcase_11 WA -
testcase_12 AC 463 ms
5,376 KB
testcase_13 AC 361 ms
5,376 KB
testcase_14 AC 543 ms
5,376 KB
testcase_15 AC 574 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 < N; i++) {
		box = 1;
		long long int c = 0;
		while (box < N) {
			bag = box;
			c += K;
			for (int j = 0; j < i; j++) {
				box += bag;
				c += Q;
				if (box >= N)break;
			}
			if (box >= N)break;
			ans = min(ans, c + ((N-box)/bag+!!((N-box)%bag))*Q);
			//cout << ans << endl;
		}
		ans = min(ans, c);
	}
	cout << ans << endl;
	return 0;
}
0