結果

問題 No.2803 Bocching Star
ユーザー RubikunRubikun
提出日時 2024-07-12 21:01:36
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 73 ms / 2,000 ms
コード長 1,050 bytes
コンパイル時間 2,354 ms
コンパイル使用メモリ 212,392 KB
実行使用メモリ 7,460 KB
最終ジャッジ日時 2024-07-12 21:02:16
合計ジャッジ時間 5,518 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 8 ms
5,376 KB
testcase_04 AC 41 ms
6,144 KB
testcase_05 AC 20 ms
5,376 KB
testcase_06 AC 5 ms
5,376 KB
testcase_07 AC 18 ms
5,376 KB
testcase_08 AC 10 ms
5,376 KB
testcase_09 AC 40 ms
6,272 KB
testcase_10 AC 45 ms
6,528 KB
testcase_11 AC 54 ms
6,788 KB
testcase_12 AC 19 ms
5,376 KB
testcase_13 AC 39 ms
6,016 KB
testcase_14 AC 23 ms
5,376 KB
testcase_15 AC 54 ms
6,672 KB
testcase_16 AC 29 ms
5,376 KB
testcase_17 AC 10 ms
5,376 KB
testcase_18 AC 7 ms
5,376 KB
testcase_19 AC 39 ms
6,016 KB
testcase_20 AC 24 ms
5,376 KB
testcase_21 AC 21 ms
5,376 KB
testcase_22 AC 22 ms
5,376 KB
testcase_23 AC 51 ms
6,784 KB
testcase_24 AC 73 ms
7,456 KB
testcase_25 AC 63 ms
7,460 KB
testcase_26 AC 66 ms
7,456 KB
testcase_27 AC 52 ms
6,912 KB
testcase_28 AC 56 ms
6,944 KB
testcase_29 AC 50 ms
6,784 KB
testcase_30 AC 65 ms
7,456 KB
testcase_31 AC 47 ms
6,784 KB
testcase_32 AC 68 ms
7,456 KB
testcase_33 AC 2 ms
5,376 KB
testcase_34 AC 3 ms
5,376 KB
testcase_35 AC 2 ms
5,376 KB
testcase_36 AC 2 ms
5,376 KB
testcase_37 AC 3 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define mp make_pair
#define si(x) int(x.size())
const int mod=998244353,MAX=300005,INF=15<<26;

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int N;cin>>N;
    ll S;cin>>S;
    vector<pair<ll,ll>> X(N);
    for(int i=0;i<N;i++){
        ll x;cin>>x;
        X[i]=mp(x,i);
    }
    sort(all(X));
    vector<int> ans;
    
    for(int i=0;i<N;i++){
        bool ok=true;
        if(i) ok&=(X[i].fi-X[i-1].fi)>S;
        if(i+1<N) ok&=(X[i+1].fi-X[i].fi)>S;
        
        if(ok) ans.push_back(X[i].se);
    }
    
    sort(all(ans));
    
    cout<<si(ans)<<endl;
    for(int a:ans) cout<<a+1<<" ";
    cout<<endl;
    
}

0