結果

問題 No.2549 Paint Eggs
ユーザー NullzNullz
提出日時 2023-11-25 14:05:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 411 ms / 2,000 ms
コード長 409 bytes
コンパイル時間 251 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 213,800 KB
最終ジャッジ日時 2023-11-25 14:05:28
合計ジャッジ時間 14,962 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
61,832 KB
testcase_01 AC 48 ms
64,312 KB
testcase_02 AC 45 ms
61,832 KB
testcase_03 AC 48 ms
62,216 KB
testcase_04 AC 48 ms
62,216 KB
testcase_05 AC 45 ms
61,448 KB
testcase_06 AC 49 ms
64,308 KB
testcase_07 AC 51 ms
64,316 KB
testcase_08 AC 42 ms
55,484 KB
testcase_09 AC 48 ms
64,284 KB
testcase_10 AC 290 ms
170,668 KB
testcase_11 AC 282 ms
203,548 KB
testcase_12 AC 256 ms
145,768 KB
testcase_13 AC 276 ms
171,564 KB
testcase_14 AC 230 ms
180,640 KB
testcase_15 AC 70 ms
81,436 KB
testcase_16 AC 305 ms
167,496 KB
testcase_17 AC 194 ms
127,096 KB
testcase_18 AC 172 ms
106,340 KB
testcase_19 AC 231 ms
151,200 KB
testcase_20 AC 373 ms
213,792 KB
testcase_21 AC 389 ms
213,800 KB
testcase_22 AC 370 ms
213,540 KB
testcase_23 AC 374 ms
213,548 KB
testcase_24 AC 376 ms
213,024 KB
testcase_25 AC 377 ms
213,796 KB
testcase_26 AC 375 ms
213,800 KB
testcase_27 AC 386 ms
213,796 KB
testcase_28 AC 369 ms
213,540 KB
testcase_29 AC 378 ms
213,796 KB
testcase_30 AC 384 ms
213,536 KB
testcase_31 AC 382 ms
213,796 KB
testcase_32 AC 378 ms
213,792 KB
testcase_33 AC 401 ms
213,796 KB
testcase_34 AC 375 ms
213,796 KB
testcase_35 AC 370 ms
213,408 KB
testcase_36 AC 411 ms
213,668 KB
testcase_37 AC 379 ms
213,792 KB
testcase_38 AC 387 ms
213,800 KB
testcase_39 AC 379 ms
213,792 KB
testcase_40 AC 358 ms
213,156 KB
testcase_41 AC 365 ms
213,156 KB
testcase_42 AC 362 ms
213,156 KB
testcase_43 AC 365 ms
213,160 KB
testcase_44 AC 358 ms
213,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque

n, m, k = map(int, input().split())
c = [*map(int, input().split())]
a = [*map(int, input().split())]
b = [deque() for _ in range(m)]
ans = [k * a[i] for i in range(m)]
for i, v in enumerate(c):
    b[v - 1].append(i)
    if i >= k:
        if b[v - 1][0] <= i - k:
            b[v - 1].popleft()
    ans[v - 1] = min(ans[v - 1], (k - len(b[v - 1])) * a[v - 1])
print(min(ans))
0