84262024-01-16 07:02:43BenedekMartonMekk Mester munkái (50 pont)cpp17Wrong answer 7/5086ms6512 KiB
#include <iostream>
//#include <queue>
#include <algorithm>

using namespace std;

struct kv
{
    int k;
    int v;
    int ind;
};

bool f(kv a, kv b)
{
    return a.v<b.v;
}

int main()
{
    int n, h;
    cin >> n >> h;
    kv mun[n];
    for(int i=0; i<n; i++)
    {
        cin >> mun[i].k >> mun[i].v;
        mun[i].ind=i+1;
    }
    //queue<int> q1, q2;
    sort(mun, mun+n, f);
    int uccso1=0, uccso2=0, sz1=0, sz2=0, muel[n];
    for(int i=0; i<n; i++)
    {
        if(uccso1<mun[i].k)
        {
            muel[i]=1;
            uccso1=mun[i].v;
            sz1++;
        }
        else if(uccso2<mun[i].k)
        {
            muel[i]=2;
            uccso2=mun[i].v;
            sz2++;
        }
        else
        {
            muel[i]=0;
        }
    }
    cout << sz1 << " " << sz2 << endl;
    for(int i=0; i<n; i++)
    {
        if(muel[i]==1)
        {
            cout << mun[i].ind << " ";
        }
    }
    cout << endl;
    for(int i=0; i<n; i++)
    {
        if(muel[i]==2)
        {
            cout << mun[i].ind << " ";
        }
    }
    cout << endl;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base7/50
1Accepted0/03ms1752 KiB
2Wrong answer0/08ms2192 KiB
3Accepted1/13ms1996 KiB
4Accepted1/13ms2128 KiB
5Wrong answer0/23ms2332 KiB
6Wrong answer0/23ms2412 KiB
7Accepted2/23ms2556 KiB
8Wrong answer0/23ms2636 KiB
9Accepted3/33ms2632 KiB
10Wrong answer0/13ms2792 KiB
11Wrong answer0/13ms2852 KiB
12Wrong answer0/23ms3060 KiB
13Wrong answer0/23ms3272 KiB
14Wrong answer0/23ms3280 KiB
15Wrong answer0/23ms3284 KiB
16Wrong answer0/33ms3280 KiB
17Wrong answer0/279ms6472 KiB
18Wrong answer0/279ms6364 KiB
19Wrong answer0/479ms6512 KiB
20Wrong answer0/479ms6496 KiB
21Wrong answer0/479ms6372 KiB
22Wrong answer0/481ms6364 KiB
23Wrong answer0/486ms6380 KiB