結果

問題 No.555 世界史のレポート
ユーザー pekempeypekempey
提出日時 2017-08-11 22:58:23
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 391 bytes
コンパイル時間 771 ms
コンパイル使用メモリ 76,764 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-20 23:14:50
合計ジャッジ時間 4,591 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 WA -
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 3 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 3 ms
5,376 KB
testcase_08 AC 3 ms
5,376 KB
testcase_09 AC 3 ms
5,376 KB
testcase_10 AC 284 ms
5,376 KB
testcase_11 AC 332 ms
5,376 KB
testcase_12 AC 279 ms
5,376 KB
testcase_13 AC 224 ms
5,376 KB
testcase_14 AC 315 ms
5,376 KB
testcase_15 AC 323 ms
5,376 KB
testcase_16 AC 254 ms
5,376 KB
testcase_17 AC 294 ms
5,376 KB
testcase_18 AC 335 ms
5,376 KB
testcase_19 AC 485 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;

long long n, c, v;

long long f(int len, int clip) {
  if (len >= n) return 0;
  clip = len;
  long long ret = 1e18;
  for (int i = 1; i < 20; i++) {
    ret = min(ret, f(len + clip * i, clip) + v * i);
  }
  return ret + c;
}

int main() {
  cin >> n >> c >> v;
  cout << f(1, 0) << endl;
}
0