結果

問題 No.1862 Copy and Paste
ユーザー fumofumofuni
提出日時 2022-03-04 21:56:45
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 536 bytes
コンパイル時間 2,936 ms
コンパイル使用メモリ 94,088 KB
最終ジャッジ日時 2025-01-28 05:15:25
ジャッジサーバーID
(参考情報)
judge3 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 7 WA * 20
権限があれば一括ダウンロードができます

ソースコード

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