結果
問題 |
No.3049 Contest Coordinator
|
ユーザー |
|
提出日時 | 2025-09-14 18:19:46 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 383 ms / 2,000 ms |
コード長 | 785 bytes |
コンパイル時間 | 520 ms |
コンパイル使用メモリ | 82,852 KB |
実行使用メモリ | 191,252 KB |
最終ジャッジ日時 | 2025-09-14 18:20:02 |
合計ジャッジ時間 | 16,040 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 58 |
ソースコード
## https://yukicoder.me/problems/no/3049 def main(): N, T, X, Y = map(int , input().split()) D = list(map(int, input().split())) D.sort() arrays = [] for d in D: if len(arrays) == 0: arrays.append([d]) else: if d - arrays[-1][-1] > T: arrays.append([d]) else: arrays[-1].append(d) weight = min(X, Y) count_arrray = [len(ar) for ar in arrays] count_arrray.sort(reverse=True) answer = [0] * N index = 0 cnt = 0 w = 0 for array in count_arrray: cnt += array while index < cnt: answer[index] = w index += 1 w += weight print(" ".join(map(str, answer))) if __name__ == '__main__': main()