225302026-01-15 10:36:19KissGergoMekk Mester munkái (50 pont)cpp17Wrong answer 0/502ms564 KiB
#include <iostream>
#include <algorithm>

struct targy
{
    float nap1,nap2,k;
};
targy a[100];

bool hasonlit(targy a, targy b)
{
    return a.nap2 < b.nap2;
}


using namespace std;

int main()
{
    bool letezik= false;
    int o[100];
    int o2[100];
    int n,h,v,db=0,bd=0;
    cin >> n >> h;
    for (int i=0; i<n; i++)
    {
        cin >> a[i].nap1 >> a[i].nap2;
        a[i].k=i+1;
    }

    sort (a, a+n,hasonlit);

    int u = a[0].nap2;
    int u2;

    o[db] = a[0].k;
    db++;

    for (int i = 1; i < n; i++)
    {
        if (a[i].nap1 > u2)
        {
            o2[bd]=a[i].k;
            u2=a[i].nap2;
            bd++;
        }
        else if (a[i].nap1 > u)
        {o[db] = a[i].k;
            db++;
            u= a[i].nap2;

        }

    }
    cout << bd << " " << db << endl;

    for (int i = 0; i < bd; i++)
    {
        cout << o2[i] << " ";

    }
    cout << endl;
for (int i = 0; i < db; i++)
    {
        cout << o[i] << " ";
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/01ms316 KiB
2Runtime error0/01ms316 KiB
3Wrong answer0/11ms316 KiB
4Wrong answer0/11ms316 KiB
5Wrong answer0/21ms400 KiB
6Wrong answer0/21ms316 KiB
7Wrong answer0/21ms316 KiB
8Wrong answer0/21ms332 KiB
9Wrong answer0/31ms316 KiB
10Runtime error0/11ms564 KiB
11Runtime error0/11ms316 KiB
12Runtime error0/21ms316 KiB
13Runtime error0/21ms500 KiB
14Runtime error0/22ms316 KiB
15Runtime error0/21ms316 KiB
16Runtime error0/32ms316 KiB
17Runtime error0/22ms316 KiB
18Runtime error0/21ms512 KiB
19Runtime error0/42ms396 KiB
20Runtime error0/41ms316 KiB
21Runtime error0/42ms316 KiB
22Runtime error0/41ms316 KiB
23Runtime error0/42ms316 KiB