149052025-02-07 09:04:44antiTűzijátékcpp17Wrong answer 1/5041ms816 KiB
#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
    int n, s, tav;
    cin >> n >> s >> tav;
    int t[n];
    for(int i=0; i<n; i++){
        cin >> t[i];
    }
    int ossz=0, meg[n],  h=1;
    meg[0] = s;
    for(int i=s-1; i>=0; i--){
        ossz += t[i+1] - t[i];
        if(ossz >= tav){
            meg[h] = i + 1;
            h++;
            ossz=0;
        }
    }
    ossz = 0;
    for(int i=s+1; i<n; i++){
        ossz = t[i] - t[i-1];
        if(ossz >= tav){
            meg[h] = i + 1;
            h++;
            ossz=0;
        }
    }
    cout << h << endl;
    sort(meg, meg+h);
    for(int i=0; i<h; i++){
        cout << meg[i] << " ";
    }
}
SubtaskSumTestVerdictTimeMemory
base1/50
1Accepted0/01ms316 KiB
2Wrong answer0/041ms816 KiB
3Partially correct1/21ms316 KiB
4Wrong answer0/21ms316 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms316 KiB
7Wrong answer0/21ms316 KiB
8Wrong answer0/21ms316 KiB
9Wrong answer0/23ms316 KiB
10Wrong answer0/24ms316 KiB
11Wrong answer0/24ms316 KiB
12Wrong answer0/27ms464 KiB
13Wrong answer0/27ms472 KiB
14Wrong answer0/27ms316 KiB
15Wrong answer0/37ms316 KiB
16Wrong answer0/310ms460 KiB
17Wrong answer0/314ms524 KiB
18Wrong answer0/318ms564 KiB
19Wrong answer0/341ms764 KiB
20Wrong answer0/339ms732 KiB
21Wrong answer0/439ms796 KiB
22Wrong answer0/441ms704 KiB