結果
| 問題 | No.555 世界史のレポート |
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2017-08-13 22:56:31 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 869 bytes |
| 記録 | |
| コンパイル時間 | 611 ms |
| コンパイル使用メモリ | 85,016 KB |
| 実行使用メモリ | 10,496 KB |
| 最終ジャッジ日時 | 2024-10-13 09:21:21 |
| 合計ジャッジ時間 | 21,463 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 TLE * 5 |
ソースコード
/* -*- coding: utf-8 -*-
*
* 555.cc: No.555 世界史のレポート - yukicoder
*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
using namespace std;
/* constant */
const int MAX_N = 50000;
const int INF = 1 << 30;
/* typedef */
/* global variables */
int dp[MAX_N + 1];
/* subroutines */
/* main */
int main() {
int n, c, v;
cin >> n >> c >> v;
dp[1] = 0;
for (int i = 2; i <= n; i++) {
int mind = INF;
for (int j = 1; j < i; j++) {
int d = dp[j] + c + (i - 1) / j * v;
if (mind > d) mind = d;
}
dp[i] = mind;
}
printf("%d\n", dp[n]);
return 0;
}
tnakao0123