結果
| 問題 |
No.3049 Contest Coordinator
|
| コンテスト | |
| ユーザー |
manuo
|
| 提出日時 | 2025-03-07 21:25:37 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 914 bytes |
| コンパイル時間 | 774 ms |
| コンパイル使用メモリ | 82,116 KB |
| 実行使用メモリ | 68,024 KB |
| 最終ジャッジ日時 | 2025-03-07 21:25:46 |
| 合計ジャッジ時間 | 7,061 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | RE * 58 |
ソースコード
from collections import deque, defaultdict, Counter
from bisect import bisect_left, bisect_right
from atcoder.fenwicktree import FenwickTree
from atcoder.segtree import SegTree
from atcoder.lazysegtree import LazySegTree
from atcoder.string import suffix_array, z_algorithm
from itertools import permutations, combinations
from functools import cache
from heapq import heappop, heappush
import math, sys
# input = sys.stdin.readline
_int = lambda x: int(x)-1
MOD = 998244353 #10**9+7
INF = 1<<60
Yes, No = "Yes", "No"
N, T, X, Y = map(int, input().split())
D = list(map(int, input().split()))
D.sort()
cnt = 1
li = []
for i in range(N-1):
if D[i+1]-D[i] > T:
li.append(cnt)
cnt = 1
else:
cnt += 1
li.append(cnt)
li.sort()
cnt = li.pop()
cost = 0
ans = []
for i in range(1, N+1):
if cnt < i:
cnt += li.pop()
cost += min(X, Y)
ans.append(cost)
print(*ans)
manuo