結果
| 問題 |
No.1862 Copy and Paste
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-05-01 23:31:31 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 730 bytes |
| コンパイル時間 | 3,454 ms |
| コンパイル使用メモリ | 277,456 KB |
| 実行使用メモリ | 13,824 KB |
| 最終ジャッジ日時 | 2024-11-22 07:38:15 |
| 合計ジャッジ時間 | 67,684 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 6 TLE * 21 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
void solve(){
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
// iad
int a, b, n;
cin >> a >> b >> n;
if (n == 1) {
cout << 0 << endl;
return 0;
}
// temp answer
int ans = a + (n - 1) * b;
for (int use_1 = 2; (1 << (use_1 - 1)) <= n; use_1++) {
priority_queue<int, vector<int>, greater<int>> pq;
int duck = 1;
int use_2 = use_1;
for (int i = 1; i <= use_1; i++) duck *= 2;
for (int i = 1; i <= use_1; i++) pq.push(2);
while (duck < n) {
int cur = pq.top();
pq.pop();
duck *= cur + 1;
duck /= cur;
use_2 += 1;
pq.push(cur + 1);
}
ans = min(ans, a * use_1 + b * use_2);
}
cout << ans << endl;
return 0;
}