127582024-12-29 22:20:44xxxMekk Mester munkái (50 pont)cpp17Wrong answer 7/5090ms4760 KiB
#include <bits/stdc++.h>
using namespace std;

#define int long long

#define f first
#define s second

signed main() {
	int n, m;
	cin >> n >> m;
	vector<pair<pair<int, int>, pair<int, bool>>> v;
	for(int i = 0; i < n; i++) {
		int x, y;
		cin >> x >> y;
		v.push_back({{y, x}, {i, 0}});
	}

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

	int most = 0;
	vector<int> ans1, ans2;

	for(int i = 0; i < n; i++) {
		//cout << v[i].f.f << ' ' << v[i].f.s << ' ' << v[i].s.f << endl;
		if (v[i].f.s > most) {
			most = v[i].f.f;
			ans1.push_back(v[i].s.f);
			v[i].s.s = 1;
		}

	}
	most = 0;
	for(int i = 0; i < n; i++) {
		if (v[i].f.s > most && v[i].s.s == 0) {
			most = v[i].f.f;
			ans2.push_back(v[i].s.f);
			v[i].s.s = 1;
		}

	}
	cout << ans1.size() << ' ' << ans2.size() << endl;
	for(auto x : ans1) {
		cout << x+1 << ' ';
	}
	cout << endl;
	for(auto x : ans2) {
		cout << x+1 << ' ';
	}
	cout << endl;


}
SubtaskSumTestVerdictTimeMemory
base7/50
1Accepted0/01ms320 KiB
2Wrong answer0/08ms948 KiB
3Accepted1/11ms508 KiB
4Accepted1/11ms508 KiB
5Wrong answer0/21ms320 KiB
6Wrong answer0/21ms320 KiB
7Accepted2/21ms508 KiB
8Wrong answer0/21ms320 KiB
9Accepted3/31ms396 KiB
10Wrong answer0/12ms320 KiB
11Wrong answer0/11ms380 KiB
12Wrong answer0/22ms320 KiB
13Wrong answer0/22ms320 KiB
14Wrong answer0/22ms468 KiB
15Wrong answer0/22ms508 KiB
16Wrong answer0/31ms320 KiB
17Wrong answer0/285ms4436 KiB
18Wrong answer0/282ms4424 KiB
19Wrong answer0/485ms4604 KiB
20Wrong answer0/483ms4532 KiB
21Wrong answer0/486ms4516 KiB
22Wrong answer0/486ms4516 KiB
23Wrong answer0/490ms4760 KiB