203432026-01-06 15:25:31BikficcMekk Mester munkái (50 pont)cpp17Wrong answer 7/5090ms2216 KiB
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

struct munka
{
    int kezd, veg, index;
};

bool hasonlit(munka a, munka b)
{
    return a.veg<b.veg;
}

int main()
{
    int n, h;
    cin >> n >> h;

    vector <munka> m(n);
    for (int i = 0; i < n; i++)
    {
        cin >> m[i].kezd >> m[i].veg;
        m[i].index = i + 1;
    }

    sort(m.begin(), m.end(), hasonlit);

    vector<int> apa, fiu;
    int vege_apa = 0, vege_fiu = 0;
    for (int i=0; i<n; i++)
    {
        if (m[i].kezd > vege_apa)
        {
            apa.push_back(m[i].index);
            vege_apa = m[i].veg;
        }
        else
            if (m[i].kezd > vege_fiu)
        {
            fiu.push_back(m[i].index);
            vege_fiu = m[i].veg;
        }
    }

    cout << apa.size() << " " << fiu.size() << endl;
    for (int x : apa)
    {
        cout << x << " ";
    }
    cout << endl;
    for (int x : fiu)
    {
        cout << x << " ";
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base7/50
1Accepted0/01ms316 KiB
2Wrong answer0/08ms508 KiB
3Accepted1/11ms508 KiB
4Accepted1/11ms316 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms316 KiB
7Accepted2/21ms316 KiB
8Wrong answer0/21ms316 KiB
9Accepted3/31ms372 KiB
10Wrong answer0/12ms560 KiB
11Wrong answer0/12ms316 KiB
12Wrong answer0/22ms316 KiB
13Wrong answer0/22ms316 KiB
14Wrong answer0/22ms316 KiB
15Wrong answer0/22ms316 KiB
16Wrong answer0/32ms316 KiB
17Wrong answer0/279ms1596 KiB
18Wrong answer0/281ms1588 KiB
19Wrong answer0/479ms1576 KiB
20Wrong answer0/481ms1584 KiB
21Wrong answer0/481ms1588 KiB
22Wrong answer0/482ms1596 KiB
23Wrong answer0/490ms2216 KiB