179732025-09-24 18:08:33algoproMekk Mester munkái (50 pont)cpp17Wrong answer 7/5089ms2228 KiB
// UUID: 27ad6c82-3e14-4281-be27-088f9aaba49e
#include <iostream>
#include <vector>
#include <array>
#include <algorithm>
using namespace std;

int main() {
    int n, h, k, v, a = 0, b = 0;
    cin >> n >> h;

    vector<array<int, 3>> tasks;

    for (int i = 0; i < n; ++i) {
        cin >> k >> v;
        tasks.push_back({ v, k, i + 1 });
    }

    sort(tasks.begin(), tasks.end());
    vector<int> mester, fia;
    
    for (int i = 0; i < n; ++i) {
        if (tasks[i][1] > a) {
            mester.push_back(tasks[i][2]);
            a = tasks[i][0];
        } else if (tasks[i][1] > b) {
            fia.push_back(tasks[i][2]);
            b = tasks[i][0];
        }
    }

    
	cout << mester.size() << ' ' << fia.size() << endl;
    for (int i = 0; i < mester.size(); ++i) {
        cout << mester[i] << ' ';
    }
    cout << endl;
    for (int i = 0; i < fia.size(); ++i) {
        cout << fia[i] << ' ';
    }
}
SubtaskSumTestVerdictTimeMemory
base7/50
1Accepted0/01ms316 KiB
2Wrong answer0/08ms568 KiB
3Accepted1/11ms316 KiB
4Accepted1/11ms316 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms316 KiB
7Accepted2/21ms316 KiB
8Wrong answer0/21ms316 KiB
9Accepted3/31ms316 KiB
10Wrong answer0/12ms316 KiB
11Wrong answer0/12ms316 KiB
12Wrong answer0/22ms508 KiB
13Wrong answer0/22ms316 KiB
14Wrong answer0/22ms316 KiB
15Wrong answer0/22ms332 KiB
16Wrong answer0/32ms316 KiB
17Wrong answer0/282ms1908 KiB
18Wrong answer0/281ms1864 KiB
19Wrong answer0/482ms1980 KiB
20Wrong answer0/481ms1960 KiB
21Wrong answer0/482ms1948 KiB
22Wrong answer0/482ms1960 KiB
23Wrong answer0/489ms2228 KiB