240662026-02-03 20:26:26sarminTűzijátékpypy3Runtime error 0/5072ms22988 KiB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
// const ll MOD = 1e9+7;

#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n, s, t; cin >> n >> s >> t;
    vector<int> a(n), res;
    for (int i = 0; i < n; i++) cin >> a[i];
    
    s--;
    res.push_back(s);
    int prevh = a[s];
    for (int i = s-1; i >= 0; i--) {
    	if (abs(a[i]-prevh) < t) continue;
    	res.push_back(i);
    	prevh = a[i];
    }
    
    prevh = a[s];
    for (int i = s+1; i < n; i++) {
    	if (abs(a[i]-prevh) < t) continue;
    	res.push_back(i);
    	prevh = a[i];
    }
    
    cout << res.size() << "\n";
    sort(res.begin(), res.end());
    for (int i : res) cout << i+1 << " ";

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Runtime error0/064ms22936 KiB
2Runtime error0/071ms22672 KiB
3Runtime error0/264ms22988 KiB
4Runtime error0/271ms22728 KiB
5Runtime error0/272ms22736 KiB
6Runtime error0/272ms22620 KiB
7Runtime error0/264ms22712 KiB
8Runtime error0/264ms22760 KiB
9Runtime error0/272ms22756 KiB
10Runtime error0/265ms22760 KiB
11Runtime error0/264ms22756 KiB
12Runtime error0/272ms22652 KiB
13Runtime error0/272ms22700 KiB
14Runtime error0/272ms22748 KiB
15Runtime error0/364ms22644 KiB
16Runtime error0/364ms22784 KiB
17Runtime error0/372ms22668 KiB
18Runtime error0/365ms22660 KiB
19Runtime error0/372ms22672 KiB
20Runtime error0/364ms22816 KiB
21Runtime error0/471ms22624 KiB
22Runtime error0/464ms22800 KiB