95442024-02-22 20:58:07Vkrisztian01Ádám és Éva együttcpp17Runtime error 0/5030ms65040 KiB
#include <iostream>
#include<vector>
#include<map>

using namespace std;

int const c=100000;
int n,adam,eva,a,b,szamlalo=0;
vector<vector<int> > nums;
vector<vector<int> > ki;

int main()
{
    cin>>n;
    nums.assign(100,vector<int>(100001,0));
    cin>>adam;
    while(adam--)
    {
        cin>>a>>b;
        nums[a/c][a%(c+1)]++;
        nums[b/c][b%(c+1)]--;
    }
    cin>>adam;
    while(adam--)
    {
        cin>>a>>b;
        nums[a/c][a%(c+1)]++;
        nums[b/c][b%(c+1)]--;
    }
    /*for(int i=0;i*c<=n;i++)
    {
        for(int j=1;j<=c;j++)
        {
            szamlalo+=nums[i][j];
            if(szamlalo==2 && nums[i][j]>0)
            {
               ki.push_back({i*c+j});
               continue;
            }
            if((szamlalo==1 && nums[i][j]==-1) || (szamlalo==0 && nums[i][j]==-2))
            {
                ki.back().push_back(i*c+j);
                continue;
            }
        }
    }*/
    cout<<ki.size()<<"\n";
    for(auto x:ki) cout<<x[0]<<" "<<x[1]<<"\n";
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Runtime error0/029ms65040 KiB
2Runtime error0/026ms64816 KiB
3Runtime error0/230ms64588 KiB
4Runtime error0/227ms64572 KiB
5Runtime error0/226ms64392 KiB
6Runtime error0/228ms64376 KiB
7Runtime error0/228ms64372 KiB
8Runtime error0/228ms64136 KiB
9Runtime error0/228ms63944 KiB
10Runtime error0/228ms63936 KiB
11Runtime error0/228ms63700 KiB
12Runtime error0/228ms63700 KiB
13Runtime error0/228ms63692 KiB
14Runtime error0/227ms63680 KiB
15Runtime error0/228ms63668 KiB
16Runtime error0/228ms63660 KiB
17Runtime error0/328ms63652 KiB
18Runtime error0/328ms63652 KiB
19Runtime error0/428ms63452 KiB
20Runtime error0/426ms63432 KiB
21Runtime error0/428ms63456 KiB
22Runtime error0/428ms63456 KiB