結果

問題 No.3049 Contest Coordinator
ユーザー sai
提出日時 2025-03-07 21:34:40
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 666 bytes
コンパイル時間 3,568 ms
コンパイル使用メモリ 279,224 KB
実行使用メモリ 8,608 KB
最終ジャッジ日時 2025-03-07 21:34:51
合計ジャッジ時間 9,603 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14 WA * 44
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int N, T, X, Y; std::cin >> N >> T >> X >> Y;
  std::vector<int> D(N);
  for (int i = 0; i < N; i++) {
    std::cin >> D[i];
  }
  std::sort(D.begin(), D.end());
  int Max = 1, cnt = 1;
  for (int i = 1; i < N; i++) {
    if (D[i] - D[i - 1] <= T) {
      cnt++;
    } else {
      cnt = 1;
    }
    Max = std::max(Max, cnt);
  }
  for (int i = 0; i < Max; i++) {
    std::cout << 0 << (i + 1 == N ? '\n' : ' ');
  }
  long long P = std::min(X, Y), ans = 0;
  for (int i = Max; i < N; i++) {
    ans += P;
    std::cout << ans << (i + 1 == N ? '\n' : ' ');
  }
}
0