40852023-03-13 09:15:43tamasmarkTűzijátékcpp17Wrong answer 17/5045ms7544 KiB

#include <iostream>
#include <vector>

using namespace std;

struct adat
{
    long long tav;
    bool lat;
};
vector<adat>x;
vector<int>megold;
int i, n, m, tav,a;

int main()
{
    cin >> n >> m >> tav;
    x.resize(n + 1);
    x[m].lat = true;
    for (i = 1; i <= n; ++i)
    {
        cin >> x[i].tav;
    }
    for (i = 1; i <= n; ++i)
    {
        if (i == 1)
        {
            megold.push_back(i);
            x[i].lat = true;
            a = i;
        }
        else if (i == m)
        {
            a=i;
            megold.push_back(i);
        }
        else
        {
            if (x[i].tav - x[a].tav >= tav)
            {
                megold.push_back(i);
                a = i;
            }
        }
    }
    cout << megold.size()<<"\n";
    for (auto& e : megold)
    {
        cout << e << " ";
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base17/50
1Accepted0/03ms1872 KiB
2Wrong answer0/043ms5420 KiB
3Accepted2/23ms2276 KiB
4Accepted2/23ms2492 KiB
5Accepted2/23ms2700 KiB
6Accepted2/23ms2952 KiB
7Wrong answer0/22ms3004 KiB
8Accepted2/23ms3004 KiB
9Accepted2/24ms3468 KiB
10Wrong answer0/26ms3628 KiB
11Wrong answer0/26ms3492 KiB
12Accepted2/28ms3872 KiB
13Wrong answer0/29ms3940 KiB
14Wrong answer0/28ms3836 KiB
15Accepted3/38ms3840 KiB
16Wrong answer0/314ms4488 KiB
17Wrong answer0/317ms5016 KiB
18Wrong answer0/321ms5348 KiB
19Wrong answer0/345ms7520 KiB
20Wrong answer0/343ms7520 KiB
21Wrong answer0/443ms7544 KiB
22Wrong answer0/443ms7156 KiB