58572023-10-04 16:01:52horkaUtazásszervezés (75 pont)cpp11Wrong answer 8/756ms4688 KiB
#include <bits/stdc++.h>
using namespace std;

int main()
{
    int napok,vez,m,n; cin>>vez>>napok>>m>>n;
    vector<int> v(n);
    for(int i=0; i<n; i++)
        cin>>v[i];
    vector<int> novel(napok+2);
    int i=1,j=0,mo=0;
    while(i<=napok && j<n)
    {
        vez+=novel[i];
        if(i==v[j])
        {
            if(vez>0)
            {
                mo++;
                vez--;
                novel[v[j]+m+1]++;
            }
            j++;
        }
        if(i<v[j]) i++;
    }
    cout<<mo<<endl;
}
SubtaskSumTestVerdictTimeMemory
base8/75
1Accepted0/03ms1808 KiB
2Wrong answer0/06ms2244 KiB
3Wrong answer0/33ms2220 KiB
4Wrong answer0/43ms2428 KiB
5Accepted4/43ms2636 KiB
6Accepted4/42ms2724 KiB
7Wrong answer0/42ms2852 KiB
8Wrong answer0/42ms3008 KiB
9Wrong answer0/53ms3316 KiB
10Wrong answer0/54ms3464 KiB
11Wrong answer0/64ms3548 KiB
12Wrong answer0/64ms3972 KiB
13Wrong answer0/64ms3784 KiB
14Wrong answer0/66ms3796 KiB
15Wrong answer0/66ms4200 KiB
16Wrong answer0/66ms4436 KiB
17Wrong answer0/66ms4688 KiB