59232023-10-05 18:24:26999Utazásszervezés (75 pont)cpp17Accepted 75/756ms3720 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> s(c);
	for(int i=0; i<c;i++)
		cin>>s[i];
	sort(s.begin(), s.end());
	int ans=0;
	vector<int> g(n);
	for(int i = 0;i<c;i++){
		int j=0;
		while(j<n){
			if(g[j]<=s[i]){
				ans++;
				g[j]=s[i]+m;
				break;
			}
			j++;
		}
	}
	cout<<ans<<'\n';
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/03ms1684 KiB
2Accepted0/06ms2096 KiB
3Accepted3/33ms2144 KiB
4Accepted4/43ms2376 KiB
5Accepted4/42ms2596 KiB
6Accepted4/43ms2900 KiB
7Accepted4/42ms2948 KiB
8Accepted4/42ms2988 KiB
9Accepted5/53ms2992 KiB
10Accepted5/53ms3008 KiB
11Accepted6/64ms3020 KiB
12Accepted6/64ms3296 KiB
13Accepted6/64ms3380 KiB
14Accepted6/66ms3720 KiB
15Accepted6/66ms3676 KiB
16Accepted6/66ms3680 KiB
17Accepted6/66ms3680 KiB