58862023-10-04 18:14:55gergomiszoriUtazásszervezés (75 pont)cpp11Wrong answer 15/756ms4236 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] += 1;
            }
            else
                break;
        }
    }


    cout << tel;


    return 0;
}
SubtaskSumTestVerdictTimeMemory
base15/75
1Accepted0/03ms1880 KiB
2Wrong answer0/06ms2360 KiB
3Accepted3/32ms2360 KiB
4Accepted4/42ms2440 KiB
5Accepted4/42ms2656 KiB
6Wrong answer0/43ms2872 KiB
7Accepted4/43ms2948 KiB
8Wrong answer0/43ms2996 KiB
9Wrong answer0/53ms3252 KiB
10Wrong answer0/53ms3604 KiB
11Wrong answer0/64ms3688 KiB
12Wrong answer0/64ms4092 KiB
13Wrong answer0/64ms3908 KiB
14Wrong answer0/66ms4188 KiB
15Wrong answer0/66ms4112 KiB
16Wrong answer0/66ms4232 KiB
17Wrong answer0/66ms4236 KiB