結果

問題 No.3049 Contest Coordinator
ユーザー とりゐ
提出日時 2025-03-07 22:59:44
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 356 bytes
コンパイル時間 399 ms
コンパイル使用メモリ 82,716 KB
実行使用メモリ 212,968 KB
最終ジャッジ日時 2025-03-07 22:59:57
合計ジャッジ時間 12,442 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 32 WA * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

N, T, X, Y = map(int, input().split())
D = list(map(int, input().split()))
D.sort()
sz = []
l = 0
for r in range(1, N):
    if D[r] - D[r - 1] > T:
        sz.append(r - l)
        l = r

sz.append(N - l)
sz.sort()
ans = []
s = sz.pop()
res = 0
for i in range(1, N + 1):
    if s < i:
        s += sz.pop()
        res += X
    ans.append(res)
print(*ans)
0