結果

問題 No.3049 Contest Coordinator
ユーザー t98slider
提出日時 2025-03-07 21:23:26
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 700 bytes
コンパイル時間 2,386 ms
コンパイル使用メモリ 205,276 KB
実行使用メモリ 10,904 KB
最終ジャッジ日時 2025-03-07 21:23:40
合計ジャッジ時間 7,501 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6 WA * 52
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n, t, x, y;
    cin >> n >> t >> x >> y;
    vector<ll> a(n);
    for(auto &&v : a) cin >> v;
    sort(a.begin(), a.end());
    vector<int> cnt;
    for(int i = 0; i < n; ){
        int p = i;
        while(i < n && a[i] <= a[max(p, i - 1)] + t) i++;
        cnt.emplace_back(i - p);
    }
    sort(cnt.rbegin(), cnt.rend());
    vector<int> ans(n);
    int sv = 0;
    for(auto &&v : cnt){
        sv += v;
        if(sv != n) ans[sv]++;
    }
    int mx = 0;
    for(int i = 0; i < n; i++){
        mx += ans[i];
        cout << mx << " \n"[i == n - 1];
    }
}
0