125562024-12-22 21:40:28BucsMateMekk Mester munkái (50 pont)cpp17Wrong answer 7/5087ms2284 KiB
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
    int N, H;
    cin >> N >> H;
    vector<pair<int, int>> megrendelesekVege(N);
    vector<int> megrendelesekEleje(N), mekk, fia;
    for(int i = 0; i < N; i++){
        int eleje, vege;
        cin >> eleje >> vege;
        megrendelesekEleje[i] = eleje;
        megrendelesekVege[i] = {vege, i};
    }
    sort(megrendelesekVege.begin(), megrendelesekVege.end());

    int utolso_munka_mekk = -1, utolso_munka_fia = -1;
    for(int i = 0; i < N; i++){
        if(megrendelesekEleje[megrendelesekVege[i].second] > utolso_munka_mekk){
            utolso_munka_mekk = megrendelesekVege[i].first;
            mekk.push_back(megrendelesekVege[i].second);
        }
        else if(megrendelesekEleje[megrendelesekVege[i].second] > utolso_munka_fia){
            utolso_munka_fia = megrendelesekVege[i].first;
            fia.push_back(megrendelesekVege[i].second);
        }
    }

    cout << mekk.size() << " " << fia.size() << endl;
    for(int i = 0; i < mekk.size(); i++){
        cout << mekk[i]+1 << " ";
    }
    cout << endl;
    for(int i = 0; i < fia.size(); i++){
        cout << fia[i]+1 << " ";
    }
    cout << endl;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base7/50
1Accepted0/01ms320 KiB
2Wrong answer0/08ms520 KiB
3Accepted1/11ms320 KiB
4Accepted1/11ms508 KiB
5Wrong answer0/21ms320 KiB
6Wrong answer0/21ms320 KiB
7Accepted2/21ms320 KiB
8Wrong answer0/21ms320 KiB
9Accepted3/31ms320 KiB
10Wrong answer0/12ms320 KiB
11Wrong answer0/12ms320 KiB
12Wrong answer0/21ms320 KiB
13Wrong answer0/22ms320 KiB
14Wrong answer0/22ms320 KiB
15Wrong answer0/22ms500 KiB
16Wrong answer0/32ms508 KiB
17Wrong answer0/279ms1772 KiB
18Wrong answer0/279ms1596 KiB
19Wrong answer0/479ms1592 KiB
20Wrong answer0/479ms1592 KiB
21Wrong answer0/481ms1604 KiB
22Wrong answer0/482ms1736 KiB
23Wrong answer0/487ms2284 KiB