結果
| 問題 |
No.3049 Contest Coordinator
|
| コンテスト | |
| ユーザー |
沙耶花
|
| 提出日時 | 2025-03-07 21:13:41 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 331 ms / 2,000 ms |
| コード長 | 743 bytes |
| コンパイル時間 | 4,621 ms |
| コンパイル使用メモリ | 258,144 KB |
| 実行使用メモリ | 14,912 KB |
| 最終ジャッジ日時 | 2025-03-07 21:13:56 |
| 合計ジャッジ時間 | 14,770 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 58 |
ソースコード
#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf32 1000000000
#define Inf64 1000000000000000001LL
int main(){
long long N,T,X,Y;
cin>>N>>T>>X>>Y;
vector<long long> d(N);
rep(i,N)cin>>d[i];
sort(d.begin(),d.end());
vector<long long> t;
rep(i,N){
if(i==0 || abs(d[i]-d[i-1])>T)t.push_back(1);
else t.back()++;
}
sort(t.rbegin(),t.rend());
vector<long long> ans(N+1);
long long sum = 0;
int ci = 1;
rep(i,t.size()){
rep(j,t[i]){
ans[ci] = sum;
ci++;
}
sum += min(X,Y);
}
for(int i=1;i<=N;i++){
if(i!=1)cout<<' ';
cout<<ans[i];
}
cout<<endl;
return 0;
}
沙耶花