結果
| 問題 |
No.1862 Copy and Paste
|
| コンテスト | |
| ユーザー |
ぷら
|
| 提出日時 | 2022-01-05 15:36:24 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 396 bytes |
| コンパイル時間 | 2,058 ms |
| コンパイル使用メモリ | 191,600 KB |
| 最終ジャッジ日時 | 2025-01-27 08:47:58 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 2 |
| other | AC * 9 WA * 18 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
constexpr long long inf = 1001001001001001001;
int main() {
long long a,b,n;
cin >> a >> b >> n;
if(n == 1) {
cout << 0 << endl;
return 0;
}
long long ans = inf;
for(int i = 1; i <= 30; i++) {
ans = min(ans,(a+b)*i+max(0ll,n-(1 << i)+(1 << (i-1))-1)/(1 << (i-1))*b);
}
cout << ans << endl;
}
ぷら