179982025-09-24 22:07:17algoproMekk Mester munkái (50 pont)cpp17Wrong answer 0/5097ms2264 KiB
// UUID: c256d3c2-cf71-4a9d-a73d-a3ea824c4e96
#include <bits/stdc++.h>
using namespace std;

int main() {
	int x, y; cin >> x >> y;
	int nowm = 0;
	int nows = 0;
	vector<array<int, 3>> z(x);
	vector<int> master(0);
	vector<int> son(0);
	for (int i = 0; i < x; i++) {
		cin >> z[i][1] >> z[i][0];
		z[i][2] = i + 1;
	}
	sort(begin(z), end(z));
	for (int i = 0; i < x; i++) {
		if (nowm >= nows) {
			if (z[i][1] >= nowm) {
				master.push_back(z[i][2]);
				nowm = z[i][0] + 1;
			}
			else if (z[i][1] >= nows) {
				son.push_back(z[i][2]);
				nows = z[i][0] + 1;
			}
		}
		else {
			if (z[i][1] >= nows) {
				son.push_back(z[i][2]);
				nows = z[i][0] + 1;
			}
			else if (z[i][1] >= nowm) {
				master.push_back(z[i][2]);
				nowm = z[i][0] + 1;
			}
		}
	}
	sort(begin(master), end(master));
	sort(begin(son), end(son));
	cout << master.size() << " " << son.size() << endl;
	for (int i : master) cout << i << " ";
	cout << endl;
	for (int i : son) cout << i << " ";
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Accepted0/01ms316 KiB
2Wrong answer0/08ms316 KiB
3Wrong answer0/11ms316 KiB
4Wrong answer0/11ms316 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms316 KiB
7Wrong answer0/21ms328 KiB
8Wrong answer0/21ms316 KiB
9Wrong answer0/31ms316 KiB
10Wrong answer0/12ms316 KiB
11Wrong answer0/12ms316 KiB
12Wrong answer0/22ms316 KiB
13Wrong answer0/22ms316 KiB
14Wrong answer0/22ms316 KiB
15Wrong answer0/22ms316 KiB
16Wrong answer0/32ms316 KiB
17Wrong answer0/282ms1584 KiB
18Wrong answer0/282ms1588 KiB
19Wrong answer0/482ms1584 KiB
20Wrong answer0/482ms1584 KiB
21Wrong answer0/483ms1584 KiB
22Wrong answer0/486ms1588 KiB
23Wrong answer0/497ms2264 KiB