結果
問題 | No.3049 Contest Coordinator |
ユーザー |
![]() |
提出日時 | 2025-03-08 17:55:59 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,177 bytes |
コンパイル時間 | 4,451 ms |
コンパイル使用メモリ | 295,172 KB |
実行使用メモリ | 38,852 KB |
最終ジャッジ日時 | 2025-03-08 17:56:12 |
合計ジャッジ時間 | 12,904 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 32 WA * 26 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define For(i, a, b) for(int i = (a); i < (b); i++)#define rep(i, n) For(i, 0, n)#define rFor(i, a, b) for(int i = (a); i >= (b); i--)#define ALL(v) (v).begin(), (v).end()#define rALL(v) (v).rbegin(), (v).rend()using lint = long long;using ld = long double;int INF = 2000000000;lint LINF = 1000000000000000000;struct SetupIo {SetupIo() {ios::sync_with_stdio(false);cin.tie(nullptr);cout << fixed << setprecision(15);}} setupio;#include <atcoder/dsu>int main() {lint n, t, x, y;cin >> n >> t >> x >> y;vector<lint> d(n);rep(i, n) {cin >> d[i];}sort(ALL(d));atcoder::dsu uf(n);rep(i, n - 1) {if (d[i + 1] - d[i] <= t) {uf.merge(i, i + 1);}}auto gr = uf.groups();int sz = gr.size();vector<int> g(sz);rep(i, sz) {g[i] = gr[i].size();}sort(rALL(g));For(i, 1, sz) {g[i] += g[i - 1];}For(k, 1, n + 1) {lint i = lower_bound(ALL(g), k) - g.begin();lint ans = x * i;cout << ans << " ";}cout << "\n";}