結果
問題 | No.555 世界史のレポート |
ユーザー |
![]() |
提出日時 | 2017-08-13 22:56:31 |
言語 | C++11 (gcc 11.4.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 869 bytes |
コンパイル時間 | 611 ms |
コンパイル使用メモリ | 85,016 KB |
実行使用メモリ | 10,496 KB |
最終ジャッジ日時 | 2024-10-13 09:21:21 |
合計ジャッジ時間 | 21,463 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
10,496 KB |
testcase_01 | AC | 1 ms
5,248 KB |
testcase_02 | AC | 1 ms
5,248 KB |
testcase_03 | AC | 2 ms
5,248 KB |
testcase_04 | AC | 2 ms
5,248 KB |
testcase_05 | AC | 2 ms
5,248 KB |
testcase_06 | AC | 2 ms
5,248 KB |
testcase_07 | AC | 2 ms
5,248 KB |
testcase_08 | AC | 2 ms
5,248 KB |
testcase_09 | AC | 3 ms
5,248 KB |
testcase_10 | AC | 1,867 ms
5,248 KB |
testcase_11 | TLE | - |
testcase_12 | AC | 1,762 ms
5,248 KB |
testcase_13 | AC | 1,339 ms
5,248 KB |
testcase_14 | TLE | - |
testcase_15 | TLE | - |
testcase_16 | AC | 1,573 ms
5,248 KB |
testcase_17 | AC | 1,908 ms
6,816 KB |
testcase_18 | TLE | - |
testcase_19 | TLE | - |
ソースコード
/* -*- 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; }