結果

問題 No.2549 Paint Eggs
ユーザー titiatitia
提出日時 2023-11-29 01:48:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 519 ms / 2,000 ms
コード長 380 bytes
コンパイル時間 76 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 41,024 KB
最終ジャッジ日時 2023-11-29 01:48:34
合計ジャッジ時間 17,426 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,112 KB
testcase_01 AC 30 ms
10,112 KB
testcase_02 AC 30 ms
10,112 KB
testcase_03 AC 28 ms
10,112 KB
testcase_04 AC 29 ms
10,112 KB
testcase_05 AC 30 ms
10,112 KB
testcase_06 AC 30 ms
10,112 KB
testcase_07 AC 30 ms
10,112 KB
testcase_08 AC 28 ms
9,984 KB
testcase_09 AC 29 ms
10,112 KB
testcase_10 AC 352 ms
37,764 KB
testcase_11 AC 321 ms
35,488 KB
testcase_12 AC 325 ms
30,168 KB
testcase_13 AC 342 ms
36,504 KB
testcase_14 AC 223 ms
28,704 KB
testcase_15 AC 52 ms
12,160 KB
testcase_16 AC 321 ms
34,032 KB
testcase_17 AC 275 ms
27,176 KB
testcase_18 AC 198 ms
25,300 KB
testcase_19 AC 284 ms
27,664 KB
testcase_20 AC 493 ms
41,024 KB
testcase_21 AC 468 ms
41,024 KB
testcase_22 AC 492 ms
41,024 KB
testcase_23 AC 506 ms
41,024 KB
testcase_24 AC 514 ms
41,024 KB
testcase_25 AC 414 ms
40,040 KB
testcase_26 AC 404 ms
41,024 KB
testcase_27 AC 423 ms
41,024 KB
testcase_28 AC 501 ms
41,024 KB
testcase_29 AC 462 ms
41,024 KB
testcase_30 AC 515 ms
41,024 KB
testcase_31 AC 435 ms
41,024 KB
testcase_32 AC 471 ms
41,024 KB
testcase_33 AC 466 ms
41,024 KB
testcase_34 AC 424 ms
40,044 KB
testcase_35 AC 503 ms
41,024 KB
testcase_36 AC 499 ms
41,024 KB
testcase_37 AC 463 ms
41,024 KB
testcase_38 AC 434 ms
41,024 KB
testcase_39 AC 448 ms
41,024 KB
testcase_40 AC 502 ms
41,024 KB
testcase_41 AC 519 ms
41,024 KB
testcase_42 AC 508 ms
41,024 KB
testcase_43 AC 515 ms
41,024 KB
testcase_44 AC 513 ms
41,024 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter

N,M,K=map(int,input().split())
B=list(map(int,input().split()))
A=list(map(int,input().split()))

MAX=[0]*(M+1)

C=Counter()
for i in range(K):
    C[B[i]]+=1

for c in C:
    MAX[c]=C[c]

for i in range(K,N):
    C[B[i]]+=1
    C[B[i-K]]-=1

    MAX[B[i]]=C[B[i]]

ANS=1<<60

for i in range(1,M+1):
    ANS=min(ANS,(K-MAX[i])*A[i-1])

print(ANS)
0