83852024-01-15 11:25:35MrChipserMekk Mester munkái (50 pont)cpp11Wrong answer 0/50699ms4640 KiB
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct munka
{
    int k;
    int v;
    int s;
};
munka m[100000];
int n,h;
bool sorted()
{
    for(int i = 0; i < n-1; i++)
    {
        if(m[i].v>m[i+1].v)
            return false;
    }
    return true;
}
int main()
{
    cin >> n >> h;
    for(int i = 0; i < n; i++)
    {
        cin >> m[i].k >> m[i].v;
        m[i].s=i+1;
    }
    while(!sorted())
    {
        for(int i = 0; i < n-1; i++)
        {
            if(m[i].v>m[i+1].v)
            {
                int a = m[i].v;
                m[i].v=m[i+1].v;
                m[i+1].v=a;
                a=m[i].k;
                m[i].k=m[i+1].k;
                m[i+1].k=a;
                a=m[i].s;
                m[i].s=m[i+1].s;
                m[i+1].s=a;
            }
        }
    }
    for(int i = 0; i < n; i++)
    {
        cout << m[i].s << " " << m[i].k << " " << m[i].v << endl;
    }
    int mekk = 0;
    int fia = 0;
    vector<int> mekkm;
    vector<int> fiam;
    for(int i = 0; i < n; i++)
    {
        if(m[i].k>mekk)
        {
            mekkm.push_back(m[i].s);
            mekk=m[i].v;

        }
        else if(m[i].k>fia)
        {
            fiam.push_back(m[i].s);
            fia=m[i].v;
        }
    }
    sort(mekkm.begin(),mekkm.end());
    sort(fiam.begin(),fiam.end());;
    cout << mekkm.size() << " " << fiam.size() << endl;
    for(int i = 0; i < mekkm.size(); i++)
        cout << mekkm[i] << " ";
    cout << endl;
    for(int i = 0; i < fiam.size(); i++)
        cout << fiam[i] << " ";
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/03ms1816 KiB
2Wrong answer0/0277ms2300 KiB
3Wrong answer0/13ms2264 KiB
4Wrong answer0/13ms2492 KiB
5Wrong answer0/23ms2548 KiB
6Wrong answer0/23ms2764 KiB
7Wrong answer0/23ms2896 KiB
8Wrong answer0/23ms3108 KiB
9Wrong answer0/33ms3320 KiB
10Wrong answer0/16ms3380 KiB
11Wrong answer0/16ms3376 KiB
12Wrong answer0/26ms3608 KiB
13Wrong answer0/26ms3816 KiB
14Wrong answer0/26ms3808 KiB
15Wrong answer0/26ms4064 KiB
16Wrong answer0/37ms4088 KiB
17Time limit exceeded0/2699ms4492 KiB
18Time limit exceeded0/2674ms4456 KiB
19Time limit exceeded0/4658ms4476 KiB
20Time limit exceeded0/4666ms4580 KiB
21Time limit exceeded0/4658ms4640 KiB
22Time limit exceeded0/4643ms4524 KiB
23Time limit exceeded0/4666ms4628 KiB