結果

問題 No.2549 Paint Eggs
コンテスト
ユーザー Kude
提出日時 2023-11-25 13:12:58
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 168 ms / 2,000 ms
コード長 413 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 260 ms
コンパイル使用メモリ 85,248 KB
実行使用メモリ 133,160 KB
最終ジャッジ日時 2026-04-13 13:10:30
合計ジャッジ時間 7,711 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 45
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n, m, k = map(int, input().split())
c = [[] for _ in range(m)]
for i, x in enumerate(map(int, input().split())):
    c[x - 1].append(i)
ans = 10 ** 9 * k
for x, indices in zip(map(int, input().split()), c):
    ans = min(ans, x * k)
    j = 0
    for i in range(len(indices)):
        while j < len(indices) and indices[j] - indices[i] < k:
            j += 1
        ans = min(ans, (k - (j - i)) * x)

print(ans)
0