234812026-01-23 17:05:58matemakaiUtazásszervezés (75 pont)cpp17Wrong answer 8/754ms560 KiB
#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];
	}

	sort(v.begin(), v.end());

	queue<int> q;
	int curr_free = n;
	int ans = 0;

	for (int i = 0; i < c; ++i) {
		while (!q.empty() && q.front() < v[i]) {
			++curr_free;
			q.pop();
		}

		if (curr_free) {
			q.push(v[i] + m);
			++ans;
			--curr_free;
		}
	}

	cout << ans << endl;
}
SubtaskSumTestVerdictTimeMemory
base8/75
1Accepted0/01ms316 KiB
2Wrong answer0/04ms316 KiB
3Wrong answer0/31ms316 KiB
4Wrong answer0/41ms316 KiB
5Accepted4/41ms316 KiB
6Accepted4/41ms508 KiB
7Wrong answer0/41ms508 KiB
8Wrong answer0/41ms316 KiB
9Wrong answer0/51ms560 KiB
10Wrong answer0/52ms544 KiB
11Wrong answer0/63ms508 KiB
12Wrong answer0/64ms476 KiB
13Wrong answer0/64ms468 KiB
14Wrong answer0/64ms456 KiB
15Wrong answer0/64ms448 KiB
16Wrong answer0/64ms484 KiB
17Wrong answer0/64ms420 KiB