43932023-03-27 12:39:30EyusieTűzijátékcpp17Wrong answer 4/5017ms4768 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    iostream::sync_with_stdio(0);
    cin.tie(0);
    int n, telh, tav;
    vector<int> varos;
    cin >> n >> telh >> tav;
    int ertek;
    for(int i = 0; i < n; i++)
    {
        cin >> ertek;
        varos.push_back(ertek);
    }
    int elozo = telh;
    set<int> erint;
    if(elozo != 0) for(int i = telh-1; i >= 0; i--)
    {
        if(varos[elozo]-varos[i] >= tav)
        {
            elozo = i;
            erint.insert(i);
        }
    }
    erint.insert(telh-1);
    elozo = telh;
    if(elozo != n-1)
    for(int i = telh+1; i < n; i++)
    {
        if(varos[i]-varos[elozo] > tav)
        {
            elozo = i;
            erint.insert(i);
        }
    }
    cout << erint.size() << "\n";
    set<int>::iterator i;
    for(i = erint.begin(); i != erint.end(); ++i)
    {
        cout << *i+1 << " ";
    }

}
SubtaskSumTestVerdictTimeMemory
base4/50
1Accepted0/03ms1704 KiB
2Wrong answer0/017ms3380 KiB
3Wrong answer0/23ms2084 KiB
4Wrong answer0/23ms2300 KiB
5Wrong answer0/23ms2500 KiB
6Wrong answer0/23ms2724 KiB
7Wrong answer0/22ms2812 KiB
8Partially correct1/23ms2816 KiB
9Wrong answer0/23ms3224 KiB
10Wrong answer0/24ms3364 KiB
11Wrong answer0/24ms3264 KiB
12Wrong answer0/24ms3744 KiB
13Wrong answer0/24ms3736 KiB
14Wrong answer0/24ms3616 KiB
15Wrong answer0/34ms3596 KiB
16Wrong answer0/36ms3784 KiB
17Wrong answer0/38ms3952 KiB
18Wrong answer0/38ms3840 KiB
19Partially correct1/317ms4668 KiB
20Wrong answer0/317ms4752 KiB
21Wrong answer0/417ms4768 KiB
22Partially correct2/414ms4552 KiB