結果

問題 No.1071 ベホマラー
ユーザー maspymaspy
提出日時 2020-06-05 22:21:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 418 bytes
コンパイル時間 259 ms
コンパイル使用メモリ 10,704 KB
実行使用メモリ 35,936 KB
最終ジャッジ日時 2023-08-22 16:09:07
合計ジャッジ時間 6,642 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
29,776 KB
testcase_01 AC 130 ms
29,700 KB
testcase_02 AC 130 ms
29,872 KB
testcase_03 AC 132 ms
29,764 KB
testcase_04 AC 136 ms
29,780 KB
testcase_05 AC 134 ms
29,840 KB
testcase_06 AC 131 ms
29,656 KB
testcase_07 AC 133 ms
29,756 KB
testcase_08 AC 130 ms
29,772 KB
testcase_09 AC 130 ms
29,792 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 156 ms
34,532 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 164 ms
35,732 KB
testcase_18 AC 164 ms
35,628 KB
testcase_19 AC 165 ms
35,764 KB
testcase_20 AC 160 ms
35,844 KB
testcase_21 WA -
testcase_22 AC 160 ms
35,884 KB
testcase_23 AC 156 ms
35,876 KB
testcase_24 AC 163 ms
35,508 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, K, X, Y = map(int, readline().split())
A = np.array(read().split(), np.int64)

# 必要回数になおす
A -= 1
A = (A + K - 1) // K

A.sort()
A = A[::-1]
A = np.append(A, 0)

Acum = np.cumsum(A)
x = Acum - np.arange(1, N + 2) * A
y = A

cost = x * X + y * Y

print(cost.min())
0