結果

問題 No.555 世界史のレポート
ユーザー ei1333333ei1333333
提出日時 2017-08-11 22:44:10
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 372 bytes
コンパイル時間 1,091 ms
コンパイル使用メモリ 159,776 KB
実行使用メモリ 10,524 KB
最終ジャッジ日時 2024-04-20 23:04:36
合計ジャッジ時間 21,340 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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 * C);
    }
  }
  cout << dp[N] << endl;
}
0