95192024-02-22 13:32:131478Mekk Mester munkái (50 pont)cpp17Wrong answer 0/50296ms21780 KiB
#include <bits/stdc++.h>  
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int,int> p32;
typedef pair<ll,ll> p64;
typedef pair<double,double> pdd;
typedef vector<ll> v64;
typedef vector<int> v32;
typedef vector<vector<int> > vv32;
typedef vector<vector<ll> > vv64;
typedef vector<vector<p64> > vvp64;
typedef vector<p64> vp64;
typedef vector<p32> vp32;
double eps = 1e-12;
#define forn(i,e) for(ll i = 0; i < e; i++)
#define forsn(i,s,e) for(ll i = s; i < e; i++)
#define rforn(i,s) for(ll i = s; i >= 0; i--)
#define rforsn(i,s,e) for(ll i = s; i >= e; i--)
#define ln "\n"
#define dbg(x) cout<<#x<<" = "<<x<<ln
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define INF 2e18
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())
ll MOD = 1e9 + 7;

bool rule(vector<int> a, vector<int> b){
	return a[1] < b[1];
}

bool rule2(vector<int> a, vector<int> b){
	return a[2] < b[2];
}
int main()
{
	//ifstream cin("in.txt");
	int n, m;
	cin >> n >> m;
	vector<vector<int>> t(n + 1, vector<int>(3));
	for(int i = 1; i <= n; i++){
		int s, e;
		cin >> s >> e;
		t[i] = {s, e, i};
	}

	
	/*for(int i = 1; i <= n; i++){
		cout << t[i][2] << " ";
	}
	cout << '\n';*/

	sort(t.begin() + 1, t.end(), rule);

	vector<vector<int>> m1, m2;
	m1.push_back(t[1]);
	if(n > 1){
		m2.push_back(t[2]);	
		for(int i = 3; i <= n; i++){
			if(t[i][0] > m1[m1.size() - 1][1] && t[i][0] > m2[m2.size() - 1][1]){
				if(m1[m1.size() - 1][1] < m2[m2.size() - 1][1]){
					m1.push_back(t[i]);
				}
				else{
					m2.push_back(t[i]);
				}
			}
			else if(t[i][0] > m1[m1.size() - 1][1]){
				m1.push_back(t[i]);
			}
			else if(t[i][0] > m2[m2.size() - 1][1]){
				m2.push_back(t[i]);
			}
		}
	}
	cout << m1.size() << " " << m2.size() << '\n';
	sort(m1.begin(), m1.end(), rule2);
	for(int i = 0; i < m1.size(); i++){
		cout << m1[i][2] << " ";
	}
	cout << '\n';
	sort(m2.begin(), m2.end(), rule2);
	for(int i = 0; i < m2.size(); i++){
		cout << m2[i][2] << " ";
	}
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/03ms1808 KiB
2Wrong answer0/018ms3032 KiB
3Wrong answer0/13ms2364 KiB
4Wrong answer0/13ms2580 KiB
5Wrong answer0/23ms2664 KiB
6Wrong answer0/23ms2664 KiB
7Wrong answer0/23ms2796 KiB
8Wrong answer0/23ms2876 KiB
9Wrong answer0/33ms2964 KiB
10Wrong answer0/14ms3332 KiB
11Wrong answer0/14ms3640 KiB
12Wrong answer0/24ms3964 KiB
13Wrong answer0/24ms4040 KiB
14Wrong answer0/24ms3972 KiB
15Wrong answer0/24ms4136 KiB
16Wrong answer0/34ms4112 KiB
17Wrong answer0/2204ms14972 KiB
18Wrong answer0/2206ms15052 KiB
19Wrong answer0/4203ms15144 KiB
20Wrong answer0/4204ms15668 KiB
21Wrong answer0/4212ms15996 KiB
22Wrong answer0/4219ms16792 KiB
23Wrong answer0/4296ms21780 KiB