結果
| 問題 | No.1071 ベホマラー |
| コンテスト | |
| ユーザー |
hir355
|
| 提出日時 | 2020-06-05 21:28:48 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 72 ms / 2,000 ms |
| + 722µs | |
| コード長 | 358 bytes |
| 記録 | |
| コンパイル時間 | 413 ms |
| コンパイル使用メモリ | 64,460 KB |
| 実行使用メモリ | 74,740 KB |
| 最終ジャッジ日時 | 2026-10-19 17:47:25 |
| 合計ジャッジ時間 | 3,544 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge6_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 21 |
ソースコード
n, k, x, y = map(int, input().split())
a = [0] + list(map(int, input().split()))
for i in range(1, n + 1):
if a[i] == 1:
a[i] = 0
else:
a[i] = (a[i] - 2) // k + 1
a.sort()
ans = 0
for i in range(n):
t = a[i + 1] - a[i]
if (n - i) * x > y:
ans += y * t
else:
ans += x * t
a[i + 1] = a[i]
print(ans)
hir355