179972025-09-24 21:57:59algoproMekk Mester munkái (50 pont)cpp17Wrong answer 0/5097ms2100 KiB
// UUID: f5af5f88-1569-4420-9ac0-64fc605403e7
#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]);
				nowm = z[i][0] + 1;
			}
			else if (z[i][1] >= nowm) {
				master.push_back(z[i][2]);
				nows = 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
1Wrong answer0/01ms316 KiB
2Wrong answer0/08ms316 KiB
3Wrong answer0/11ms316 KiB
4Wrong answer0/11ms316 KiB
5Wrong answer0/21ms556 KiB
6Wrong answer0/21ms316 KiB
7Wrong answer0/21ms364 KiB
8Wrong answer0/21ms316 KiB
9Wrong answer0/31ms376 KiB
10Wrong answer0/12ms316 KiB
11Wrong answer0/12ms408 KiB
12Wrong answer0/22ms316 KiB
13Wrong answer0/22ms316 KiB
14Wrong answer0/22ms316 KiB
15Wrong answer0/22ms316 KiB
16Wrong answer0/32ms316 KiB
17Wrong answer0/282ms1588 KiB
18Wrong answer0/282ms1584 KiB
19Wrong answer0/483ms1588 KiB
20Wrong answer0/483ms1588 KiB
21Wrong answer0/483ms1784 KiB
22Wrong answer0/486ms1584 KiB
23Wrong answer0/497ms2100 KiB