21052022-12-20 07:27:31szabel26Tűzijátékcpp17Wrong answer 0/5045ms4836 KiB
#include <iostream>
#include <vector>
#include <deque>
#include <algorithm>

using namespace std;

deque<int>v;
vector<int>telepules;
vector<int>helyek;

int i,n,s,t,db;

int main()
{
    cin>>n>>s>>t;
    telepules.resize(n+1);
    for(i=1;i<=n;++i) cin>>telepules[i];

    v.push_back(telepules[s]);
    for(i=s-1;i>=1;--i)
    {
        if(v[0]-telepules[i]>=t){
            v.push_back(telepules[i]);
            helyek.push_back(i);
            v.pop_front();
            ++db;
        }
    }
    v.pop_front();
    v.push_back(telepules[s]);
    helyek.push_back(s);
    for(i=s+1;i<=n;++i)
    {
        if(telepules[i]-v[0]>=t){
            v.push_back(telepules[i]);
            helyek.push_back(i);
            v.pop_front();
            ++db;
        }
    }
    sort(helyek.begin(),helyek.end());

    cout<<db<<"\n";
    for (auto &e:helyek) cout<<e<<" ";
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/03ms1812 KiB
2Wrong answer0/043ms3032 KiB
3Wrong answer0/22ms2260 KiB
4Wrong answer0/22ms2312 KiB
5Wrong answer0/22ms2508 KiB
6Wrong answer0/22ms2716 KiB
7Wrong answer0/22ms2920 KiB
8Wrong answer0/22ms3000 KiB
9Wrong answer0/24ms3028 KiB
10Wrong answer0/24ms3036 KiB
11Wrong answer0/24ms3296 KiB
12Wrong answer0/28ms3284 KiB
13Wrong answer0/28ms3540 KiB
14Wrong answer0/28ms3480 KiB
15Wrong answer0/38ms3488 KiB
16Wrong answer0/313ms3672 KiB
17Wrong answer0/317ms3840 KiB
18Wrong answer0/320ms4088 KiB
19Wrong answer0/345ms4584 KiB
20Wrong answer0/343ms4708 KiB
21Wrong answer0/443ms4836 KiB
22Wrong answer0/443ms4688 KiB