99542024-03-21 09:10:14VargusMekk Mester munkái (50 pont)cpp17Wrong answer 7/5092ms9352 KiB
#include <iostream>
#include <queue>
#include <algorithm>
#define ll long long

using namespace std;

struct adat
{
	ll el, veg, poz;
};

vector <adat> x;

bool sorts(const adat& a, const adat& b)
{
	return a.veg < b.veg;
}

int main()
{
	ll n, h;
	cin >> n >> h;
	for (ll i = 1; i <= n; ++i)
	{
		ll a, b;
		cin >> a >> b;
		x.push_back({ a, b, i });
	}
	sort(x.begin(), x.end(), sorts);
	ll m1v = 0, m2v = 0, m1 = 0, m2 = 0;
	deque <ll> p1, p2;
	for (ll i = 0; i < n; ++i)
	{
		if (m1v < x[i].el && x[i].veg <= h)
		{
			m1v = x[i].veg;
			++m1;
			p1.push_front(x[i].poz);
		}
		else if (m2v < x[i].el && x[i].veg <= h)
		{
			m2v = x[i].veg;
			++m2;
			p2.push_front(x[i].poz);
		}
	}
	cout << m1 << " " << m2 << endl;
	for (ll i = p1.size() - 1; i >= 0; --i)
		cout << p1[i] << " ";
	cout << endl;
	for (ll i = p2.size() - 1; i >= 0; --i)
		cout << p2[i] << " ";

	return 0;
}
SubtaskSumTestVerdictTimeMemory
base7/50
1Accepted0/03ms1812 KiB
2Wrong answer0/09ms3088 KiB
3Accepted1/13ms2264 KiB
4Accepted1/13ms2308 KiB
5Wrong answer0/23ms2304 KiB
6Wrong answer0/23ms2436 KiB
7Accepted2/23ms2548 KiB
8Wrong answer0/23ms2620 KiB
9Accepted3/33ms2628 KiB
10Wrong answer0/13ms2920 KiB
11Wrong answer0/13ms2864 KiB
12Wrong answer0/23ms3124 KiB
13Wrong answer0/23ms3200 KiB
14Wrong answer0/23ms3080 KiB
15Wrong answer0/23ms3428 KiB
16Wrong answer0/33ms3296 KiB
17Wrong answer0/283ms9348 KiB
18Wrong answer0/283ms9344 KiB
19Wrong answer0/482ms9352 KiB
20Wrong answer0/483ms9348 KiB
21Wrong answer0/483ms9348 KiB
22Wrong answer0/485ms9352 KiB
23Wrong answer0/492ms9348 KiB