結果

問題 No.3049 Contest Coordinator
ユーザー Kude
提出日時 2025-03-07 21:17:23
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 407 bytes
コンパイル時間 929 ms
コンパイル使用メモリ 82,732 KB
実行使用メモリ 212,820 KB
最終ジャッジ日時 2025-03-07 21:17:36
合計ジャッジ時間 13,262 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 34 WA * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

n, t, x, y = map(int, input().split())
d = sorted(map(int, input().split()))
a = []
now = 0
last = d[0]
for x in d:
    if x - last <= t:
        now += 1
    else:
        a.append(now)
        now = 1
    last = x
a.append(now)
a.sort()
rest = a.pop()
ans = [0]
for _ in range(n):
    ans.append(ans[-1])
    if rest == 0:
        rest += a.pop()
        ans[-1] += min(x, y)
    rest -= 1
print(*ans[1:])
0