結果
問題 | No.3049 Contest Coordinator |
ユーザー |
|
提出日時 | 2025-03-07 23:16:44 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 971 bytes |
コンパイル時間 | 2,428 ms |
コンパイル使用メモリ | 203,528 KB |
実行使用メモリ | 9,260 KB |
最終ジャッジ日時 | 2025-03-07 23:16:52 |
合計ジャッジ時間 | 7,985 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 WA * 49 |
ソースコード
#include<bits/stdc++.h>using namespace std;using ll=long long;#define all(v) v.begin(),v.end()#define rall(v) v.rbegin(),v.rend()template<class T> bool chmax(T &a, T b){if (a < b){a = b;return true;} else return false;}template<class T> bool chmin(T &a, T b){if (a > b){a = b;return true;} else return false;}void Solve(){int N;ll T,X,Y;cin>>N>>T>>X>>Y;vector<ll>D(N);for(int i=0;i<N;i++)cin>>D[i];sort(all(D));int l=0;vector<int>V;while(l<N){int r=l;while(r+1<N&&D[r+1]-D[r]<=T){r++;}V.push_back(r-l+1);l=r+1;}sort(all(V));ll ans=0;bool flag=true;for(int i=0;i<N;i++){if(!flag){ans+=min(X,Y);flag=true;}V.back()--;if(V.back()==0)flag=false;cout<<ans<<" ";}cout<<"\n";}int main(){ios::sync_with_stdio(false);cin.tie(nullptr);Solve();}