59832023-10-09 17:13:56MorvaiVarkonyUtazásszervezés (75 pont)cpp11Accepted 75/756ms4252 KiB
// Source: https://usaco.guide/general/io

#include <bits/stdc++.h>
using namespace std;

int main() {
	int n,k,m,c;
	cin >> n >> k >> m >> c;
	vector<int> v(c);
	for (int i=0; i<c; i++) {
		cin >> v[i];
	}
	int jo=0;
	int min;
	for (int i=0; i<n; i++) {
		min=0;
		for (int j=0; j<c; j++) {
			if (v[j]>min) {
				jo++;
				min=v[j]+m-1;
				v[j]=0;
			}
		}
	}
	cout << jo;
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/03ms1812 KiB
2Accepted0/06ms2168 KiB
3Accepted3/33ms2216 KiB
4Accepted4/42ms2428 KiB
5Accepted4/42ms2640 KiB
6Accepted4/42ms2720 KiB
7Accepted4/43ms2976 KiB
8Accepted4/43ms2964 KiB
9Accepted5/53ms3048 KiB
10Accepted5/53ms3048 KiB
11Accepted6/64ms3180 KiB
12Accepted6/64ms3408 KiB
13Accepted6/64ms3616 KiB
14Accepted6/64ms3712 KiB
15Accepted6/66ms4044 KiB
16Accepted6/66ms4252 KiB
17Accepted6/66ms4208 KiB