結果

問題 No.2549 Paint Eggs
ユーザー konchakoncha
提出日時 2023-11-25 13:15:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 160 ms / 2,000 ms
コード長 404 bytes
コンパイル時間 233 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 113,652 KB
最終ジャッジ日時 2023-11-25 13:15:20
合計ジャッジ時間 7,539 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
59,960 KB
testcase_01 AC 43 ms
60,216 KB
testcase_02 AC 41 ms
59,960 KB
testcase_03 AC 42 ms
59,576 KB
testcase_04 AC 42 ms
59,960 KB
testcase_05 AC 38 ms
53,460 KB
testcase_06 AC 44 ms
62,364 KB
testcase_07 AC 42 ms
59,960 KB
testcase_08 AC 37 ms
53,460 KB
testcase_09 AC 42 ms
59,576 KB
testcase_10 AC 122 ms
106,232 KB
testcase_11 AC 110 ms
107,532 KB
testcase_12 AC 102 ms
105,072 KB
testcase_13 AC 114 ms
102,916 KB
testcase_14 AC 93 ms
98,072 KB
testcase_15 AC 50 ms
66,456 KB
testcase_16 AC 110 ms
105,192 KB
testcase_17 AC 93 ms
104,048 KB
testcase_18 AC 88 ms
102,760 KB
testcase_19 AC 98 ms
102,724 KB
testcase_20 AC 133 ms
113,648 KB
testcase_21 AC 133 ms
113,396 KB
testcase_22 AC 159 ms
113,644 KB
testcase_23 AC 133 ms
113,396 KB
testcase_24 AC 136 ms
113,648 KB
testcase_25 AC 131 ms
113,648 KB
testcase_26 AC 130 ms
113,528 KB
testcase_27 AC 131 ms
113,648 KB
testcase_28 AC 133 ms
113,524 KB
testcase_29 AC 133 ms
113,400 KB
testcase_30 AC 160 ms
113,648 KB
testcase_31 AC 133 ms
113,648 KB
testcase_32 AC 133 ms
113,648 KB
testcase_33 AC 132 ms
113,648 KB
testcase_34 AC 131 ms
113,520 KB
testcase_35 AC 134 ms
113,648 KB
testcase_36 AC 133 ms
113,648 KB
testcase_37 AC 133 ms
113,652 KB
testcase_38 AC 133 ms
113,524 KB
testcase_39 AC 132 ms
113,648 KB
testcase_40 AC 133 ms
113,648 KB
testcase_41 AC 142 ms
113,524 KB
testcase_42 AC 130 ms
113,396 KB
testcase_43 AC 135 ms
113,400 KB
testcase_44 AC 135 ms
113,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M, K = map(int, input().split())
C = list(map(lambda x: int(x)-1, input().split()))
A = list(map(int, input().split()))

eggs = [0]*M

for c in C[:K]:
    eggs[c] += 1

answer = float("inf")
for color, count in enumerate(eggs):
    answer = min(A[color]*(K-count), answer)

for del_c, c in zip(C, C[K:]):
    eggs[del_c] -= 1
    eggs[c] += 1
    answer = min(A[c]*(K-eggs[c]), answer)

print(answer)
0