47012023-03-31 09:42:03gyjazminÁdám és Éva együttcpp11Wrong answer 11/50228ms4880 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;
    for(int i=0;i<db;i++){
        cout << valaszel[i] << " " << valaszveg[i] << endl;
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base11/50
1Accepted0/03ms1828 KiB
2Wrong answer0/03ms2056 KiB
3Accepted2/23ms2264 KiB
4Accepted2/23ms2480 KiB
5Accepted2/23ms2528 KiB
6Accepted2/22ms2524 KiB
7Wrong answer0/23ms2656 KiB
8Wrong answer0/23ms2872 KiB
9Wrong answer0/23ms2952 KiB
10Wrong answer0/23ms3224 KiB
11Wrong answer0/23ms3076 KiB
12Wrong answer0/23ms3200 KiB
13Wrong answer0/23ms3264 KiB
14Wrong answer0/23ms3264 KiB
15Wrong answer0/23ms3272 KiB
16Runtime error0/2172ms4880 KiB
17Wrong answer0/3197ms4224 KiB
18Accepted3/3165ms4072 KiB
19Wrong answer0/4181ms4204 KiB
20Wrong answer0/4228ms4372 KiB
21Wrong answer0/4201ms4340 KiB
22Wrong answer0/4200ms4500 KiB