95402024-02-22 20:08:04Vkrisztian01Ádám és Éva együttcpp17Wrong answer 4/5056ms11828 KiB
#include <iostream>
#include<vector>
#include<map>

using namespace std;

vector<vector<int> > ki;

int main()
{
    int n,adam,eva,a,b,szamlalo=0;
    cin>>n;
    map<int,int> nums;
    cin>>adam;
    while(adam--)
    {
        cin>>a>>b;
        ++nums[a];
        --nums[b];
    }
    cin>>eva;
    while(eva--)
    {
        cin>>a>>b;
        ++nums[a];
        --nums[b];
    }
    for(int i=1;i<=n;i++)
    {
        /*szamlalo+=nums[i];
        if(szamlalo==2 && nums[i]>0)
        {
            ki.push_back({i});
            continue;
        }
        if((szamlalo==1 && nums[i]==-1) || (szamlalo==0 && nums[i]==-2))
        {
            ki.back().push_back(i);
            continue;
        }*/
    }
    cout<<ki.size()<<"\n";
    for(auto x:ki) cout<<x[0]<<" "<<x[1]<<"\n";
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base4/50
1Wrong answer0/03ms1812 KiB
2Wrong answer0/03ms2056 KiB
3Wrong answer0/23ms2412 KiB
4Accepted2/23ms2648 KiB
5Wrong answer0/23ms2732 KiB
6Accepted2/23ms2944 KiB
7Wrong answer0/23ms3160 KiB
8Wrong answer0/23ms3328 KiB
9Wrong answer0/23ms3408 KiB
10Wrong answer0/23ms3600 KiB
11Wrong answer0/23ms3612 KiB
12Wrong answer0/23ms3744 KiB
13Wrong answer0/23ms3824 KiB
14Wrong answer0/23ms3820 KiB
15Wrong answer0/23ms4072 KiB
16Wrong answer0/252ms11120 KiB
17Wrong answer0/352ms11312 KiB
18Wrong answer0/346ms10764 KiB
19Wrong answer0/450ms10984 KiB
20Wrong answer0/456ms11828 KiB
21Wrong answer0/452ms11340 KiB
22Wrong answer0/452ms11328 KiB