47142023-03-31 09:52:39gyjazminÁdám és Éva együttcpp11Wrong answer 11/50333ms5924 KiB
#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main()
{
    iostream::sync_with_stdio(0);
    cin.tie(0);
    int p;
    cin >> p;
    int a;
    cin >> a;
    vector<int> ael(a);
    vector<int> aveg(a);
    for(int i=0;i<a;i++){
        cin >> ael[i] >> aveg[i];
    }
    int e;
    cin >> e;
    vector<int> eel(e);
    vector<int> eveg(e);
    for(int i=0;i<e;i++){
        cin >> eel[i] >> eveg[i];
    }
    vector<int> valaszel;
    vector<int> valaszveg;
    int db= 0;
    for(int i=0;i<a;i++){
        int cv=0;
        while(eel[cv]<aveg[i]){
            if(ael[i]<eveg[cv]){
                valaszel.push_back(max(ael[i],eel[cv]));
                valaszveg.push_back(min(aveg[i],eveg[cv]));
                db++;
            }
            cv++;
        }
    }
    cout << db << endl;
    vector <pair<int,int>> svektor(db);
    for(int i=0;i<db;i++){
        svektor.push_back(make_pair(valaszel[i],valaszveg[i]));
    }
    sort(svektor.begin(),svektor.end());
    for(int i=0;i<db;i++){
        cout << valaszel[i] << " " << valaszveg[i] << endl;
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base11/50
1Accepted0/03ms1824 KiB
2Wrong answer0/03ms2068 KiB
3Accepted2/23ms2272 KiB
4Accepted2/23ms2484 KiB
5Accepted2/23ms2524 KiB
6Accepted2/23ms2756 KiB
7Wrong answer0/22ms2676 KiB
8Wrong answer0/23ms2808 KiB
9Wrong answer0/23ms3012 KiB
10Wrong answer0/23ms3116 KiB
11Wrong answer0/23ms3116 KiB
12Wrong answer0/23ms3232 KiB
13Wrong answer0/23ms3292 KiB
14Wrong answer0/23ms3416 KiB
15Wrong answer0/23ms3528 KiB
16Runtime error0/2245ms5264 KiB
17Wrong answer0/3273ms5400 KiB
18Accepted3/3241ms5248 KiB
19Wrong answer0/4250ms5388 KiB
20Wrong answer0/4333ms5924 KiB
21Runtime error0/4250ms5892 KiB
22Wrong answer0/4273ms5832 KiB