64752023-12-03 11:56:35xxxUtazásszervezés (75 pont)cpp14Accepted 75/756ms4084 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n, k, m, c;
	cin >> n >> k >> m >> c;
    vector<int> gs(c);
    for(int i = 0; i < c; i++) {
        cin >> gs[i];
    }

    vector<int> mettol(n, 1);
    int ans = 0;

    for(int i = 0; i < c; i++) {
        for(int j = 0; j < n; j++) {
            if (mettol[j] <= gs[i]) {
                mettol[j] = gs[i] + m;
                ans++;
                j = n;
            }
        }

    }



    cout << ans << '\n';

	return 0;
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/03ms2088 KiB
2Accepted0/06ms2308 KiB
3Accepted3/33ms2352 KiB
4Accepted4/43ms2572 KiB
5Accepted4/43ms2712 KiB
6Accepted4/43ms2956 KiB
7Accepted4/43ms3084 KiB
8Accepted4/43ms3108 KiB
9Accepted5/53ms3200 KiB
10Accepted5/53ms3416 KiB
11Accepted6/64ms3512 KiB
12Accepted6/64ms3528 KiB
13Accepted6/64ms3656 KiB
14Accepted6/66ms3748 KiB
15Accepted6/66ms3744 KiB
16Accepted6/66ms3876 KiB
17Accepted6/66ms4084 KiB