結果

問題 No.2549 Paint Eggs
ユーザー t98slidert98slider
提出日時 2023-11-26 21:47:54
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 715 bytes
コンパイル時間 2,533 ms
コンパイル使用メモリ 207,152 KB
実行使用メモリ 13,636 KB
最終ジャッジ日時 2023-11-26 21:48:02
合計ジャッジ時間 7,062 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
6,676 KB
testcase_02 WA -
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 AC 2 ms
6,676 KB
testcase_06 WA -
testcase_07 AC 2 ms
6,676 KB
testcase_08 AC 2 ms
6,676 KB
testcase_09 AC 2 ms
6,676 KB
testcase_10 AC 55 ms
11,276 KB
testcase_11 AC 45 ms
11,760 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 40 ms
9,472 KB
testcase_15 AC 4 ms
6,676 KB
testcase_16 AC 50 ms
10,368 KB
testcase_17 AC 34 ms
7,552 KB
testcase_18 AC 29 ms
6,912 KB
testcase_19 AC 40 ms
8,960 KB
testcase_20 WA -
testcase_21 AC 65 ms
13,508 KB
testcase_22 AC 68 ms
13,508 KB
testcase_23 AC 67 ms
13,636 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 67 ms
13,636 KB
testcase_27 AC 70 ms
13,636 KB
testcase_28 AC 68 ms
13,636 KB
testcase_29 AC 68 ms
13,508 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 67 ms
13,508 KB
testcase_33 AC 67 ms
13,636 KB
testcase_34 AC 82 ms
13,636 KB
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 70 ms
13,636 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 67 ms
13,508 KB
testcase_41 AC 67 ms
13,636 KB
testcase_42 AC 66 ms
13,508 KB
testcase_43 WA -
testcase_44 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

template<class T> istream& operator >> (istream& is, vector<T>& vec) {
    for(T& x : vec) is >> x;
    return is;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, m, k;
    cin >> n >> m >> k;
    vector<vector<int>> tb(m);
    vector<ll> a(m);
    for(int i = 0, v; i < n; i++){
        cin >> v;
        tb[--v].emplace_back(i);
    }
    cin >> a;
    ll ans = 1ll << 61;
    for(int i = 0; i < m; i++){
        for(int l = 0, r = 0; l < tb[i].size(); l++){
            while(r < tb[i].size() && tb[i][r] < tb[i][l] + k) r++;
            ans = min(ans, a[i] * (k - r + l));
        }
    }
    cout << ans << '\n';
}
0