結果

問題 No.555 世界史のレポート
ユーザー ei1333333ei1333333
提出日時 2017-08-11 22:45:28
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 380 bytes
コンパイル時間 1,356 ms
コンパイル使用メモリ 159,180 KB
実行使用メモリ 13,760 KB
最終ジャッジ日時 2024-04-20 23:05:24
合計ジャッジ時間 7,535 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
13,760 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 3 ms
6,940 KB
testcase_05 AC 3 ms
6,940 KB
testcase_06 AC 3 ms
6,944 KB
testcase_07 AC 3 ms
6,944 KB
testcase_08 AC 3 ms
6,944 KB
testcase_09 AC 4 ms
6,944 KB
testcase_10 TLE -
testcase_11 TLE -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>

using namespace std;

typedef long long int64;
const int64 INF = 1LL << 60;


int main()
{
  int N, C, V;
  cin >> N >> C >> V;

  int64 dp[50001];
  fill_n(dp, 50001, INF);
  dp[1] = C;
  for(int i = 2; i <= N; i++) {
    for(int j = 1; j < i; j++) {
      dp[i] = min(dp[i], dp[j] + (i - j + j - 1) / j * V + C);
    }
  }
  cout << dp[N] - C << endl;
}
0