結果

問題 No.1071 ベホマラー
ユーザー maspymaspy
提出日時 2020-06-05 22:23:20
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 440 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 10,652 KB
実行使用メモリ 35,996 KB
最終ジャッジ日時 2023-08-22 16:11:51
合計ジャッジ時間 6,761 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
29,792 KB
testcase_01 AC 124 ms
29,852 KB
testcase_02 AC 123 ms
29,764 KB
testcase_03 AC 122 ms
29,748 KB
testcase_04 AC 122 ms
29,800 KB
testcase_05 AC 123 ms
29,748 KB
testcase_06 AC 123 ms
29,864 KB
testcase_07 AC 123 ms
29,796 KB
testcase_08 AC 123 ms
29,800 KB
testcase_09 AC 123 ms
29,808 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 147 ms
34,732 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 157 ms
35,868 KB
testcase_18 AC 155 ms
35,872 KB
testcase_19 AC 161 ms
35,716 KB
testcase_20 AC 149 ms
35,736 KB
testcase_21 WA -
testcase_22 AC 150 ms
35,872 KB
testcase_23 AC 149 ms
35,776 KB
testcase_24 AC 155 ms
35,808 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, dtype=np.int64) * A
y = A

cost = x * X + y * Y

x, y

print(cost.min())
0