結果

問題 No.2549 Paint Eggs
ユーザー ntudantuda
提出日時 2023-12-02 09:58:09
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 400 bytes
コンパイル時間 477 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 111,960 KB
最終ジャッジ日時 2023-12-02 09:58:21
合計ジャッジ時間 10,013 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
59,972 KB
testcase_01 AC 37 ms
59,976 KB
testcase_02 AC 37 ms
59,956 KB
testcase_03 AC 36 ms
59,460 KB
testcase_04 WA -
testcase_05 AC 34 ms
59,460 KB
testcase_06 AC 37 ms
59,964 KB
testcase_07 AC 37 ms
59,828 KB
testcase_08 AC 34 ms
53,460 KB
testcase_09 AC 36 ms
59,460 KB
testcase_10 AC 109 ms
106,092 KB
testcase_11 AC 119 ms
106,556 KB
testcase_12 AC 93 ms
105,928 KB
testcase_13 AC 105 ms
105,440 KB
testcase_14 WA -
testcase_15 AC 49 ms
66,324 KB
testcase_16 WA -
testcase_17 AC 83 ms
103,908 KB
testcase_18 AC 76 ms
102,016 KB
testcase_19 AC 88 ms
103,836 KB
testcase_20 AC 116 ms
111,956 KB
testcase_21 AC 118 ms
111,704 KB
testcase_22 WA -
testcase_23 AC 124 ms
111,696 KB
testcase_24 AC 118 ms
111,956 KB
testcase_25 WA -
testcase_26 AC 119 ms
111,836 KB
testcase_27 AC 116 ms
111,956 KB
testcase_28 AC 117 ms
111,832 KB
testcase_29 WA -
testcase_30 AC 119 ms
111,956 KB
testcase_31 AC 115 ms
111,956 KB
testcase_32 AC 118 ms
111,952 KB
testcase_33 AC 121 ms
111,956 KB
testcase_34 AC 135 ms
111,832 KB
testcase_35 AC 115 ms
111,956 KB
testcase_36 AC 119 ms
111,952 KB
testcase_37 AC 116 ms
111,956 KB
testcase_38 WA -
testcase_39 AC 123 ms
111,956 KB
testcase_40 AC 122 ms
111,952 KB
testcase_41 AC 119 ms
111,696 KB
testcase_42 AC 121 ms
111,700 KB
testcase_43 AC 119 ms
111,704 KB
testcase_44 AC 130 ms
111,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M, K = map(int, input().split())
C = list(map(int, input().split()))
A = list(map(int, input().split()))
X = [0] * (M + 1)  # X[j]:=区間の長さKの中にある色jの数
for i in range(K):
    X[C[i]] += 1
ans = 10 ** 15
for i in range(M):
    ans = min(ans, (K - X[i]) * A[i])
for i in range(K,N):
    X[C[i-K]] -= 1
    X[C[i]] += 1
    ans = min(ans, (K - X[C[i]]) * A[C[i]-1])
print(ans)

0