230882026-01-16 11:50:58helloworldMekk Mester munkái (50 pont)cpp17Wrong answer 4/5083ms2204 KiB
#include <iostream>
#include <algorithm>
using namespace std;

int N, M;

struct Munka {
    int a, b, id;
};

Munka m[100000];

int id_A[100000];
int id_B[100000];
int dbA = 0, dbB = 0;

int main()
{
    cin >> N >> M;

    for(int i = 0; i < N; i++){
        cin >> m[i].a >> m[i].b;
        m[i].id = i + 1;
    }

    sort(m, m + N, [](Munka x, Munka y){
        return x.b < y.b;
    });

    int vegeA = 0, vegeB = 0;

    for(int i = 0; i < N; i++){
        int a = m[i].a;
        int b = m[i].b;

        if(a >= vegeA){
            id_A[dbA++] = m[i].id;
            vegeA = b;
        }
        else if(a >= vegeB){
            id_B[dbB++] = m[i].id;
            vegeB = b;
        }
    }

    cout << dbA << " " << dbB << "\n";

    for(int i = 0; i < dbA; i++){
        cout << id_A[i] << " ";
    }
    cout << "\n";

    for(int i = 0; i < dbB; i++){
        cout << id_B[i] << " ";
    }

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base4/50
1Wrong answer0/01ms316 KiB
2Wrong answer0/08ms508 KiB
3Accepted1/11ms316 KiB
4Accepted1/11ms316 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms316 KiB
7Accepted2/21ms508 KiB
8Wrong answer0/22ms416 KiB
9Wrong answer0/31ms316 KiB
10Wrong answer0/12ms316 KiB
11Wrong answer0/12ms428 KiB
12Wrong answer0/22ms316 KiB
13Wrong answer0/22ms560 KiB
14Wrong answer0/22ms316 KiB
15Wrong answer0/22ms416 KiB
16Wrong answer0/31ms316 KiB
17Wrong answer0/275ms1528 KiB
18Wrong answer0/275ms1336 KiB
19Wrong answer0/475ms1340 KiB
20Wrong answer0/476ms1484 KiB
21Wrong answer0/478ms1436 KiB
22Wrong answer0/479ms1588 KiB
23Wrong answer0/483ms2204 KiB