58962023-10-04 18:40:37kidesoUtazásszervezés (75 pont)cpp17Accepted 75/754ms4564 KiB
#include <iostream>
using namespace std;
#define f(i,k,n) for(int i=k; i<n; i++)
#define ll long long

void solve()
{
    int n,k,m,c;
    cin>>n>>k>>m>>c;
    int a[k+1]={0};
    int x;
    int maxi=0;
    //f(i,0,c)
    int b[c];
    f(i,0,c) cin>>b[i];

    for(int i=0; i<c; i++)
    {
        if(a[b[i]]<n) 
        {
            maxi++;
            f(j,b[i],b[i]+m)    a[j]++;
        }
    } 
    //f(i,1,k+1)  cout<<a[i];
    cout<<maxi;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int t=1;
    //cin>>t;
    while(t--)  solve();
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/03ms1888 KiB
2Accepted0/04ms2368 KiB
3Accepted3/33ms2340 KiB
4Accepted4/43ms2552 KiB
5Accepted4/42ms2768 KiB
6Accepted4/43ms2868 KiB
7Accepted4/42ms3064 KiB
8Accepted4/43ms3428 KiB
9Accepted5/53ms3656 KiB
10Accepted5/53ms3968 KiB
11Accepted6/63ms4180 KiB
12Accepted6/63ms4308 KiB
13Accepted6/63ms4240 KiB
14Accepted6/64ms4232 KiB
15Accepted6/64ms4364 KiB
16Accepted6/64ms4472 KiB
17Accepted6/64ms4564 KiB