136602025-01-08 12:20:55RRoliMekk Mester munkái (50 pont)cpp17Wrong answer 7/5082ms2220 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n, m;
	cin >> n >> m;
	vector<pair<pair<int, int>, int>> v(n);
	for(int i = 0; i < n; i++) {
		cin >> v[i].first.second >> v[i].first.first;
		v[i].second = i+1;
	}
	sort(v.begin(), v.end());

	int mm = 1, f = 1;
	vector<int> MM, F;
	for(int i = 0; i < n; i++) {
		if(v[i].first.second >= mm) {
			MM.push_back(v[i].second);
			mm = v[i].first.first + 1;
		} else if(v[i].first.second >= f) {
			F.push_back(v[i].second);
			f = v[i].first.first + 1;
		}
	}

	cout << MM.size() << ' ' << F.size() << '\n';
	for(auto i : MM) cout << i << ' ';
	cout << '\n';
	for(auto i : F) cout << i << ' ';

	return 0;
}
SubtaskSumTestVerdictTimeMemory
base7/50
1Accepted0/01ms316 KiB
2Wrong answer0/08ms316 KiB
3Accepted1/11ms316 KiB
4Accepted1/11ms316 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms316 KiB
7Accepted2/21ms316 KiB
8Wrong answer0/21ms316 KiB
9Accepted3/31ms500 KiB
10Wrong answer0/12ms500 KiB
11Wrong answer0/12ms316 KiB
12Wrong answer0/22ms352 KiB
13Wrong answer0/22ms316 KiB
14Wrong answer0/21ms316 KiB
15Wrong answer0/22ms588 KiB
16Wrong answer0/32ms500 KiB
17Wrong answer0/276ms1580 KiB
18Wrong answer0/278ms1580 KiB
19Wrong answer0/476ms1588 KiB
20Wrong answer0/476ms1580 KiB
21Wrong answer0/476ms1588 KiB
22Wrong answer0/478ms1592 KiB
23Wrong answer0/482ms2220 KiB