結果

問題 No.2549 Paint Eggs
ユーザー ntudantuda
提出日時 2023-12-02 10:02:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 413 bytes
コンパイル時間 352 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 112,000 KB
最終ジャッジ日時 2023-12-02 10:02:17
合計ジャッジ時間 8,241 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
59,968 KB
testcase_01 AC 38 ms
60,104 KB
testcase_02 AC 37 ms
59,960 KB
testcase_03 AC 37 ms
59,460 KB
testcase_04 AC 37 ms
59,844 KB
testcase_05 AC 36 ms
59,448 KB
testcase_06 AC 43 ms
60,100 KB
testcase_07 AC 38 ms
59,832 KB
testcase_08 AC 34 ms
53,460 KB
testcase_09 AC 37 ms
59,460 KB
testcase_10 AC 118 ms
107,552 KB
testcase_11 AC 102 ms
106,768 KB
testcase_12 AC 96 ms
106,244 KB
testcase_13 AC 107 ms
104,124 KB
testcase_14 AC 88 ms
98,432 KB
testcase_15 AC 46 ms
66,328 KB
testcase_16 AC 102 ms
106,512 KB
testcase_17 AC 88 ms
105,032 KB
testcase_18 AC 82 ms
102,828 KB
testcase_19 AC 98 ms
103,672 KB
testcase_20 AC 126 ms
111,996 KB
testcase_21 AC 125 ms
111,744 KB
testcase_22 AC 127 ms
111,996 KB
testcase_23 AC 125 ms
111,736 KB
testcase_24 AC 129 ms
111,996 KB
testcase_25 AC 133 ms
112,000 KB
testcase_26 AC 129 ms
111,744 KB
testcase_27 AC 130 ms
111,996 KB
testcase_28 AC 124 ms
111,744 KB
testcase_29 AC 127 ms
111,744 KB
testcase_30 AC 125 ms
112,000 KB
testcase_31 AC 126 ms
111,996 KB
testcase_32 AC 126 ms
111,992 KB
testcase_33 AC 126 ms
111,996 KB
testcase_34 AC 124 ms
111,748 KB
testcase_35 AC 126 ms
111,996 KB
testcase_36 AC 131 ms
111,996 KB
testcase_37 AC 125 ms
111,996 KB
testcase_38 AC 124 ms
111,740 KB
testcase_39 AC 125 ms
112,000 KB
testcase_40 AC 124 ms
112,000 KB
testcase_41 AC 125 ms
111,736 KB
testcase_42 AC 124 ms
111,744 KB
testcase_43 AC 131 ms
111,740 KB
testcase_44 AC 124 ms
111,740 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M, K = map(int, input().split())
C = [i-1 for i in 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]])
print(ans)

0