46982023-03-31 09:35:24gyjazminÁdám és Éva együttcpp11Wrong answer 8/50228ms5652 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
base8/50
1Accepted0/03ms1824 KiB
2Wrong answer0/03ms2060 KiB
3Accepted2/23ms2104 KiB
4Accepted2/23ms2232 KiB
5Accepted2/23ms2324 KiB
6Accepted2/22ms2320 KiB
7Wrong answer0/22ms2316 KiB
8Wrong answer0/23ms2452 KiB
9Wrong answer0/23ms2700 KiB
10Wrong answer0/23ms2848 KiB
11Wrong answer0/22ms2852 KiB
12Wrong answer0/23ms3088 KiB
13Wrong answer0/23ms3068 KiB
14Wrong answer0/23ms3064 KiB
15Wrong answer0/23ms3128 KiB
16Wrong answer0/2211ms4192 KiB
17Runtime error0/3174ms4896 KiB
18Wrong answer0/3172ms4652 KiB
19Wrong answer0/4181ms5040 KiB
20Wrong answer0/4228ms5100 KiB
21Runtime error0/4175ms5652 KiB
22Wrong answer0/4219ms5168 KiB