58852023-10-04 18:14:02gergomiszoriUtazásszervezés (75 pont)cpp11Wrong answer 15/756ms4088 KiB
#include <bits/stdc++.h>

using namespace std;

int tel;
int n, k, m, c;
int ind;
vector<int> igenyek;
vector<int> veg;

int main()
{
    cin >> n >> k >> m >> c;
    igenyek.resize(c);
    veg.resize(k);

    for(int i = 0; i < c; i++) cin >> igenyek[i];

    for(int i = 1; i < k+1; i++)
    {
        n += veg[i];
        while(ind < igenyek.size() && igenyek[ind] < i) ind++;
        int tempn = n;
        for(int j = 0; j < tempn; j++)
        {
            if(igenyek[ind] == i)
            {
                tel++; n--; veg[i+m] += 1;
            }
            else
                break;
        }
    }


    cout << tel;


    return 0;
}
SubtaskSumTestVerdictTimeMemory
base15/75
1Accepted0/03ms1880 KiB
2Wrong answer0/06ms2328 KiB
3Accepted3/32ms2316 KiB
4Accepted4/42ms2364 KiB
5Accepted4/42ms2484 KiB
6Wrong answer0/43ms2588 KiB
7Accepted4/43ms2796 KiB
8Wrong answer0/43ms3216 KiB
9Wrong answer0/53ms3176 KiB
10Wrong answer0/53ms3196 KiB
11Wrong answer0/64ms3508 KiB
12Wrong answer0/64ms3768 KiB
13Wrong answer0/64ms3720 KiB
14Wrong answer0/64ms3876 KiB
15Wrong answer0/66ms3832 KiB
16Wrong answer0/66ms4088 KiB
17Wrong answer0/66ms4048 KiB