248272026-02-15 21:54:24999Mekk Mester munkái (50 pont)cpp17Wrong answer 0/5096ms3756 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());
    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;
    sort(ansf.begin(),ansf.end());
    sort(ansa.begin(),ansa.end());
    for(int i : ansf)cout<<i<<' ';
    cout<<endl;
    for(int i : ansa)cout<<i<<' ';
    cout<<endl;

}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/01ms316 KiB
2Wrong answer0/08ms564 KiB
3Wrong answer0/11ms508 KiB
4Wrong answer0/11ms316 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms316 KiB
7Wrong answer0/21ms316 KiB
8Wrong answer0/21ms316 KiB
9Wrong answer0/31ms316 KiB
10Wrong answer0/12ms316 KiB
11Wrong answer0/12ms316 KiB
12Wrong answer0/22ms316 KiB
13Wrong answer0/21ms316 KiB
14Wrong answer0/22ms420 KiB
15Wrong answer0/22ms316 KiB
16Wrong answer0/32ms512 KiB
17Wrong answer0/282ms2756 KiB
18Wrong answer0/282ms2764 KiB
19Wrong answer0/482ms2760 KiB
20Wrong answer0/482ms2756 KiB
21Wrong answer0/486ms2628 KiB
22Wrong answer0/486ms2868 KiB
23Wrong answer0/496ms3756 KiB