結果
問題 | No.3049 Contest Coordinator |
ユーザー |
|
提出日時 | 2025-03-07 21:14:32 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 338 ms / 2,000 ms |
コード長 | 752 bytes |
コンパイル時間 | 1,008 ms |
コンパイル使用メモリ | 80,636 KB |
実行使用メモリ | 8,608 KB |
最終ジャッジ日時 | 2025-03-07 21:14:45 |
合計ジャッジ時間 | 11,498 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 58 |
ソースコード
#include <algorithm> #include <iostream> #include <vector> using namespace std; typedef long long ll; int main() { int n, t; ll x, y; cin >> n >> t >> x >> y; int s[500005]; for (int i = 0; i < n; i++) { cin >> s[i]; } sort(s, s + n); vector<int> v; int c = 0; for (int i = 0; i < n; i++) { c++; if (i == n - 1 || s[i + 1] - s[i] > t) { v.push_back(c); c = 0; } } sort(v.begin(), v.end(), greater<int>()); int i = 0; int d = 0; for (int k = 1; k <= n; k++) { i++; cout << d * min(x, y) << " "; if (i == v[d]) { d++; i = 0; } } cout << endl; }