45172023-03-29 12:10:59EyusieTűzijátékcpp17Wrong answer 0/5017ms6772 KiB
#include <bits/stdc++.h>

using namespace std;

int n, telh, tav;
vector<int> kapcs;
vector<int> varos;



int main()
{
    iostream::sync_with_stdio(0);
    cin.tie(0);
    cin >> n >> telh >> tav;
    kapcs.assign(n, 100001);
    int ertek;
    int counter = 0;
    for(int i = 0; i < n; i++)
    {
        cin >> ertek;
        varos.push_back(ertek);
    }
    set<int> varosok;
    int current = telh-1;
    for(int i = telh-2; i >= 0; i--)
    {
        if(varos[current] - varos[i] >= tav)
        {
            varosok.insert(i+1);
            counter++;
            current = i;
        }
    }
    current = telh-1;
    for(int i = telh; i < varos.size(); i++)
    {
        if(varos[i] - varos[current] >= tav)
        {
            varosok.insert(i+1);
            counter++;
            current = i;
        }
    }
        varosok.insert(telh);
        cout << varosok.size();
        for(set<int>::iterator itr = varosok.begin(); itr != varosok.end(); ++itr)
        {
            cout << *itr << " ";
        }
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/03ms1828 KiB
2Wrong answer0/017ms4480 KiB
3Wrong answer0/23ms2312 KiB
4Wrong answer0/23ms2388 KiB
5Wrong answer0/23ms2588 KiB
6Wrong answer0/23ms2640 KiB
7Wrong answer0/23ms2824 KiB
8Wrong answer0/23ms3176 KiB
9Wrong answer0/23ms3496 KiB
10Wrong answer0/24ms3612 KiB
11Wrong answer0/24ms3616 KiB
12Wrong answer0/24ms4120 KiB
13Wrong answer0/24ms4096 KiB
14Wrong answer0/24ms4316 KiB
15Wrong answer0/34ms4208 KiB
16Wrong answer0/37ms4460 KiB
17Wrong answer0/38ms4872 KiB
18Wrong answer0/38ms5176 KiB
19Wrong answer0/317ms6532 KiB
20Wrong answer0/317ms6688 KiB
21Wrong answer0/417ms6772 KiB
22Wrong answer0/414ms6460 KiB