90152024-02-12 10:37:34IgnácUtazásszervezés (75 pont)cpp17Wrong answer 8/756ms4104 KiB
// Source: https://usaco.guide/general/io

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

int main() {
	int n, k, m, c;
	cin >> n >> k >> m >> c;
	priority_queue<int> end;
	int db = 0;
	for (int i = 0; i < c; i++) {
		int ig;
		cin >> ig;
		while (end.size() > 0 && end.top() > -ig) end.pop();
		if (end.size() < n) {
			db++;
			end.push(-ig - m);
		}
	}

	cout << db;
}
SubtaskSumTestVerdictTimeMemory
base8/75
1Accepted0/03ms1812 KiB
2Wrong answer0/06ms2184 KiB
3Wrong answer0/33ms2176 KiB
4Wrong answer0/43ms2656 KiB
5Accepted4/43ms2608 KiB
6Accepted4/43ms2828 KiB
7Wrong answer0/43ms2916 KiB
8Wrong answer0/43ms2920 KiB
9Wrong answer0/53ms2916 KiB
10Wrong answer0/54ms3056 KiB
11Wrong answer0/64ms3176 KiB
12Wrong answer0/64ms3408 KiB
13Wrong answer0/64ms3424 KiB
14Wrong answer0/66ms3456 KiB
15Wrong answer0/66ms3640 KiB
16Wrong answer0/66ms3944 KiB
17Wrong answer0/66ms4104 KiB