89142024-02-04 20:54:01gergomiszoriUtazásszervezés (75 pont)cpp17Wrong answer 11/754ms4432 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;
    ll a = 0, b = 0;
    for(ll i = 0; i < c; i++)
    {
        ll in;
        cin >> in;
        if(a < in)
        {
            ans++;
            a = in+m-1;
        }
        else
        if(b < in)
        {
            ans++;
            b = in+m-1;
        }
    }
    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
base11/75
1Accepted0/03ms1888 KiB
2Wrong answer0/04ms2220 KiB
3Accepted3/33ms2228 KiB
4Wrong answer0/43ms2444 KiB
5Wrong answer0/43ms2588 KiB
6Accepted4/43ms2788 KiB
7Accepted4/43ms2876 KiB
8Wrong answer0/43ms3004 KiB
9Wrong answer0/53ms3232 KiB
10Wrong answer0/53ms3324 KiB
11Wrong answer0/63ms3328 KiB
12Wrong answer0/64ms3608 KiB
13Wrong answer0/63ms3888 KiB
14Wrong answer0/64ms3820 KiB
15Wrong answer0/64ms4172 KiB
16Wrong answer0/64ms4432 KiB
17Wrong answer0/64ms4420 KiB