結果

問題 No.2803 Bocching Star
ユーザー zeta7532zeta7532
提出日時 2024-07-09 20:42:38
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 858 bytes
コンパイル時間 2,620 ms
コンパイル使用メモリ 213,124 KB
実行使用メモリ 8,584 KB
最終ジャッジ日時 2024-07-09 20:42:48
合計ジャッジ時間 9,353 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 16 ms
6,944 KB
testcase_04 AC 110 ms
6,940 KB
testcase_05 AC 55 ms
6,940 KB
testcase_06 AC 10 ms
6,940 KB
testcase_07 AC 36 ms
6,940 KB
testcase_08 AC 20 ms
6,944 KB
testcase_09 AC 86 ms
6,944 KB
testcase_10 AC 98 ms
6,944 KB
testcase_11 AC 106 ms
7,400 KB
testcase_12 AC 35 ms
6,944 KB
testcase_13 AC 81 ms
6,940 KB
testcase_14 AC 57 ms
6,944 KB
testcase_15 AC 101 ms
7,148 KB
testcase_16 AC 57 ms
6,944 KB
testcase_17 AC 19 ms
6,940 KB
testcase_18 AC 14 ms
6,944 KB
testcase_19 AC 81 ms
6,940 KB
testcase_20 AC 48 ms
6,944 KB
testcase_21 AC 38 ms
6,944 KB
testcase_22 AC 40 ms
6,944 KB
testcase_23 AC 102 ms
7,040 KB
testcase_24 AC 125 ms
8,576 KB
testcase_25 AC 113 ms
8,480 KB
testcase_26 AC 114 ms
8,584 KB
testcase_27 AC 114 ms
7,556 KB
testcase_28 AC 110 ms
7,432 KB
testcase_29 AC 99 ms
7,040 KB
testcase_30 AC 116 ms
8,584 KB
testcase_31 AC 98 ms
7,040 KB
testcase_32 AC 123 ms
8,580 KB
testcase_33 AC 2 ms
6,944 KB
testcase_34 AC 3 ms
6,940 KB
testcase_35 AC 2 ms
6,944 KB
testcase_36 AC 2 ms
6,944 KB
testcase_37 AC 3 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
using ll = long long;
const ll mod = 998244353;
#define fi first
#define se second
#define rep(i,n) for(ll i=0;i<n;i++)
#define all(x) x.begin(),x.end()
#define faster ios::sync_with_stdio(false);cin.tie(nullptr)

int main() {
    ll N,S;
    cin >> N >> S;
    vector<pair<ll,ll>> P(N);
    rep(i,N){
        cin >> P[i].fi;
        P[i].se=i;
    }
    sort(all(P));
    vector<ll> ans;
    rep(i,N){
        bool ok=true;
        if(i>0) if(P[i].fi-P[i-1].fi<=S) ok=false;
        if(i<N-1) if(P[i+1].fi-P[i].fi<=S) ok=false;
        if(ok) ans.push_back(P[i].se);
    }
    sort(all(ans));
    cout << ans.size() << endl;
    rep(i,ans.size()){
        cout << ans[i]+1 << " ";
    }
    cout << endl;
    return 0;
}
0