89162024-02-04 21:02:14gergomiszoriUtazásszervezés (75 pont)cpp17Accepted 75/754ms3768 KiB
#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define endl "\n"
#define pll pair<ll,ll>
#define vll vector<ll>
#define mll map<ll,ll>
#define fs first
#define sc second

const ll MOD = 1e9+7;

void solve()
{
    ll n, k, m, c;
    cin >> n >> k >> m >> c;
    ll ans = 0;
    vector<ll> occ(n, 0);
    for(ll i = 0; i < c; i++)
    {
        ll in;
        cin >> in;
        for(ll &a : occ)
            if(a < in)
            {
                ans++;
                a = in+m-1;
                break;
            }
    }
    cout << ans << endl;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    ll t = 1;
    //cin >> t;
    while(t--)
        solve();
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/03ms1832 KiB
2Accepted0/04ms2204 KiB
3Accepted3/33ms2072 KiB
4Accepted4/43ms2300 KiB
5Accepted4/43ms2384 KiB
6Accepted4/43ms2580 KiB
7Accepted4/42ms2628 KiB
8Accepted4/43ms2760 KiB
9Accepted5/53ms2852 KiB
10Accepted5/53ms3256 KiB
11Accepted6/63ms3140 KiB
12Accepted6/63ms3356 KiB
13Accepted6/63ms3572 KiB
14Accepted6/64ms3500 KiB
15Accepted6/64ms3628 KiB
16Accepted6/64ms3768 KiB
17Accepted6/64ms3632 KiB