結果

問題 No.1862 Copy and Paste
ユーザー fumofumofunifumofumofuni
提出日時 2022-03-04 22:59:23
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 557 bytes
コンパイル時間 764 ms
コンパイル使用メモリ 71,440 KB
実行使用メモリ 5,200 KB
最終ジャッジ日時 2023-09-26 02:13:18
合計ジャッジ時間 37,894 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 TLE -
testcase_10 AC 70 ms
4,380 KB
testcase_11 TLE -
testcase_12 AC 1,219 ms
4,380 KB
testcase_13 TLE -
testcase_14 AC 54 ms
4,380 KB
testcase_15 AC 963 ms
4,380 KB
testcase_16 TLE -
testcase_17 AC 933 ms
4,380 KB
testcase_18 AC 520 ms
4,384 KB
testcase_19 TLE -
testcase_20 TLE -
testcase_21 AC 1,141 ms
4,376 KB
testcase_22 TLE -
testcase_23 TLE -
testcase_24 TLE -
testcase_25 AC 1 ms
4,380 KB
testcase_26 TLE -
testcase_27 TLE -
testcase_28 TLE -
testcase_29 AC 1,966 ms
4,380 KB
testcase_30 AC 163 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
using namespace std;
using ll=long long;
ll N, C, V;
int main() {
	cin >> C >> V >> N;
    if(N==1)cout << 0 << endl,exit(0);
	ll ret = 1LL << 62;
	for (ll i = 1; i <= 30; i++) {
		bool flag = false;
		for (ll j = 1; !flag; j++) {
			for (ll k = i; k >= 1; k--) {
				long long mul = 1;
				for (ll l = 0; l < k; l++) mul *= j;
				for (ll l = k; l < i; l++) mul *= j + 1;
				if (mul >= N) {
					ret = min(ret, (i * j - k) * V + C * i);
					flag = true; break;
				}
			}
		}
	}
	cout << ret << endl;
	return 0;
}
0