結果

問題 No.664 超能力者Aと株価予測
ユーザー konsin_tokagekonsin_tokage
提出日時 2018-04-06 20:51:02
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 504 bytes
コンパイル時間 650 ms
コンパイル使用メモリ 59,124 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-08 18:04:10
合計ジャッジ時間 1,623 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;
#define ll long long
ll a[391], dp[391], tmp[391];
int main(){
    int n, m, k;
    cin >> n >> m >> k;
    ++n;
    for(int i=1; i<=n; ++i) cin >> a[i];
    tmp[0] = k;
    for(int j=1; j<=m; ++j){
        for(int i=1; i<=n; ++i){
            tmp[i] = tmp[i-1];
            for(int k=1; k<i; ++k)
                tmp[i] = max(tmp[i], dp[k]%a[k]+dp[k]/a[k]*a[i]);
        }
        swap(dp, tmp);
    }
    cout << dp[n] << endl;
    return 0;
}
0