99382024-03-20 07:23:14VargusMekk Mester munkái (50 pont)cpp17Wrong answer 4/50699ms6128 KiB
#include <iostream>
#include <queue>
#define ll long long

using namespace std;

int main()
{
    ll n, k, v, h, m1 = 0, m2 = 0;
    cin >> n >> h;
    vector < pair <ll, ll> > a;
    deque <ll> p1, p2;
    for (ll i = 1; i <= n; ++i)
    {
        cin >> k >> v;
        a.push_back({ k, v });
    }

    ll i, akt1 = 0, akt2 = 0;
    for (ll t = 1; t <= h; ++t)
    {
        i = 1;
        for (auto& e : a)
        {
            if (t == e.second)
            {
                if (akt1 < e.first)
                {
                    akt1 = e.second;
                    ++m1;
                    p1.push_front(i);
                    break;
                }
                if (akt2 < e.first)
                {
                    akt2 = e.second;
                    ++m2;
                    p2.push_front(i);
                    break;
                }
            }
            ++i;
        }
    }
    cout << m1 << " " << m2 << endl;
    for (ll j = p1.size() - 1; j >= 0; --j)
        cout << p1[j] << " ";
    cout << endl;

    for (ll j = p2.size() - 1; j >= 0; --j)
        cout << p2[j] << " ";

    return 0;
}

SubtaskSumTestVerdictTimeMemory
base4/50
1Accepted0/03ms1812 KiB
2Wrong answer0/072ms2672 KiB
3Accepted1/110ms2284 KiB
4Accepted1/110ms2492 KiB
5Wrong answer0/210ms2704 KiB
6Wrong answer0/210ms2788 KiB
7Accepted2/210ms2916 KiB
8Wrong answer0/210ms3124 KiB
9Wrong answer0/33ms3372 KiB
10Wrong answer0/167ms3608 KiB
11Wrong answer0/167ms3764 KiB
12Wrong answer0/267ms3732 KiB
13Wrong answer0/267ms3944 KiB
14Wrong answer0/267ms3940 KiB
15Wrong answer0/267ms4312 KiB
16Wrong answer0/33ms4296 KiB
17Time limit exceeded0/2699ms5656 KiB
18Time limit exceeded0/2661ms5944 KiB
19Time limit exceeded0/4629ms6128 KiB
20Time limit exceeded0/4681ms5904 KiB
21Time limit exceeded0/4674ms6012 KiB
22Time limit exceeded0/4666ms5948 KiB
23Time limit exceeded0/4653ms5904 KiB