結果

問題 No.555 世界史のレポート
ユーザー kotamanegikotamanegi
提出日時 2017-08-11 23:39:36
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,267 bytes
コンパイル時間 884 ms
コンパイル使用メモリ 101,124 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-04-20 23:48:34
合計ジャッジ時間 4,731 ms
ジャッジサーバーID
(参考情報)
judge7 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream> 
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>  
using namespace std;
#define eps 0.00000001
#define LONG_INF 10000000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define REP(i,n) for(long long i = 0;i < n;++i)
long long n, c, v;
long long judge(long long sep,long long maxium) {
	long long now = 1;
	long long board = 1;
	int j = 0;
	for (j = 0;now < n;++j) {
		now += board;
		if ((j + 1) % sep == 0 && (j + 1) / sep <= maxium) {
			board = now;
		}
	}
	return j;
}
int main() {
	cin >> n >> c >> v;
	long long ans = 10000000000;
	for (int copy = 0;copy < n&&copy < 20;++copy) {
		long long minnimum = 100000;
		for (int i = 1;i <= n;++i) {
			minnimum = min(minnimum, judge(i, copy));
		}
		ans = min(ans, copy*c + minnimum*v);
	}
	cout << ans+c << endl;
	return 0;
}
0