248282026-02-15 22:12:03999Mekk Mester munkái (50 pont)cpp17Wrong answer 7/5090ms3756 KiB
// Source: https://usaco.guide/general/io

#include <bits/stdc++.h>
#define int long long
using namespace std;

signed main() {
    int n,h;cin>>n>>h;
    vector<array<int,3>> v(n);
    for(int i = 0;i<n;i++){
        cin>>v[i][1]>>v[i][0];
        v[i][2]=i+1;
    }
    sort(v.begin(),v.end());
    /*for(int i = 0;i<n;i++){
        cout<<v[i][0]<<' '<<v[i][1]<<' '<<v[i][2]<<endl;
    }*/
    vector<int> ansf,ansa;
    int fiuel=0,apael=0,ans=0;
    for(int i = 0;i<n;i++){
        if(fiuel<v[i][1]){
            ansf.push_back(v[i][2]);
            fiuel=v[i][0];
        }
        else if(apael<v[i][1]){
            ansa.push_back(v[i][2]);
            apael=v[i][0];
        }
    }
    cout<<ansf.size()<<' '<<ansa.size()<<endl;
    for(int i : ansf)cout<<i<<' ';
    cout<<endl;
    for(int i : ansa)cout<<i<<' ';
    cout<<endl;

}
SubtaskSumTestVerdictTimeMemory
base7/50
1Accepted0/01ms316 KiB
2Wrong answer0/08ms564 KiB
3Accepted1/11ms316 KiB
4Accepted1/11ms316 KiB
5Wrong answer0/21ms332 KiB
6Wrong answer0/21ms500 KiB
7Accepted2/21ms316 KiB
8Wrong answer0/21ms316 KiB
9Accepted3/31ms316 KiB
10Wrong answer0/12ms316 KiB
11Wrong answer0/12ms500 KiB
12Wrong answer0/22ms316 KiB
13Wrong answer0/22ms316 KiB
14Wrong answer0/22ms544 KiB
15Wrong answer0/22ms316 KiB
16Wrong answer0/32ms316 KiB
17Wrong answer0/282ms2756 KiB
18Wrong answer0/282ms2764 KiB
19Wrong answer0/482ms2752 KiB
20Wrong answer0/483ms2756 KiB
21Wrong answer0/483ms2864 KiB
22Wrong answer0/485ms2868 KiB
23Wrong answer0/490ms3756 KiB