結果
問題 | No.3049 Contest Coordinator |
ユーザー |
|
提出日時 | 2025-03-07 21:37:08 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 169 ms / 2,000 ms |
コード長 | 991 bytes |
コンパイル時間 | 6,406 ms |
コンパイル使用メモリ | 333,048 KB |
実行使用メモリ | 14,640 KB |
最終ジャッジ日時 | 2025-03-07 21:37:23 |
合計ジャッジ時間 | 14,559 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 58 |
ソースコード
#include <bits/stdc++.h> using namespace std; #include <atcoder/all> using namespace atcoder; using mint = atcoder::static_modint<998244353>; // using mint = atcoder::static_modint<1000000007>; using ld = long double; using ll = long long; #define mp(a,b) make_pair(a,b) #define rep(i,s,n) for(int i=s; i<(int)n; i++) const vector<int> dx{1,0,-1,0},dy{0,1,0,-1}; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int n;cin>> n; ll t,x,y;cin >> t >> x >> y; ll d[n]; rep(i,0,n)cin >> d[i]; sort(d,d+n); vector<ll> a; int cnt=1; rep(i,1,n){ if(d[i]-d[i-1]>t){ a.push_back(cnt); cnt=1; } else cnt++; } a.push_back(cnt); sort(a.begin(),a.end(),greater()); int len=1; vector<ll> ans(n+1); int size=0; rep(i,0,a.size()){ size+=a[i]; // cout << size << " "; for(; len<=size; len++)ans[len]=i*min(x,y); } rep(i,1,n+1)cout << ans[i] << " "; }