結果

問題 No.1862 Copy and Paste
ユーザー fumofumofunifumofumofuni
提出日時 2022-03-04 21:56:45
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 536 bytes
コンパイル時間 581 ms
コンパイル使用メモリ 70,828 KB
実行使用メモリ 4,508 KB
最終ジャッジ日時 2023-09-26 00:52:52
合計ジャッジ時間 33,324 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <algorithm>
using namespace std;
int N, C, V;
int main() {
	cin >> C >> V >> N;
    if(N==1)cout << 0 << endl,exit(0);
	int ret = 1 << 30;
	for (int i = 1; i <= 30; i++) {
		bool flag = false;
		for (int j = 1; !flag; j++) {
			for (int k = i; k >= 1; k--) {
				int mul = 1;
				for (int l = 0; l < k; l++) mul *= j;
				for (int 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