39642023-03-07 06:16:20AncsaZsonglőrködéscpp11Wrong answer 0/1001.549s60828 KiB
#include <bits/stdc++.h>

using namespace std;

/*
5
1 5
4 5
5 8
5 9
1 9
*/

/*
9
1 3
2 4
8 10
1 7
2 7
2 3
9 11
3 9
3 8
*/
/*
bool eszerint(Interv i1, Interv i2)
{
    if (i1.e!=i2.e)
       return i1.e<i2.e;
    else
       return i1.v<i2.v;
}
*/


int main()
{
    int n;
    cin>>n;
    map <int,int> eleje, vege;
    pair<int, int> musor;
    //vector<pair<int, int>> m(n);

    for(int i=0;i<n;i++)
    {
        cin>>musor.first>>musor.second;

        eleje[musor.first]++;
        vege[musor.second]++;
    }


    //sort(musor.begin(),musor.end(),eszerint);
/*
    for(pair<int,int> x: m)
        cout<<x.first<<"-"<<x.second<<endl;
*/
    int napok=n;
/*
    for(int i=0;i<m.size();i++)
    {
        eleje[m.at(i).first]++;
        vege[m.at(i).second]++;

    }
*/

    cout<<"eleje:\n";
    for(pair<int,int> x:eleje)
       cout<<x.first<<" "<<x.second<<endl;

    cout<<"vege:" <<endl;
    for(pair<int,int> x:vege)
       cout<<x.first<<" "<<x.second<<endl;

    for(pair<int,int> x:eleje)
    {
       if(min(vege[x.first],x.first)>0)
             napok-=min(x.first,vege[x.first]);
    }

    cout<<endl<<napok;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer3ms1808 KiB
2Wrong answer3ms2060 KiB
subtask20/20
3Wrong answer14ms2756 KiB
4Wrong answer252ms19288 KiB
5Wrong answer930ms44820 KiB
6Wrong answer1.332s53468 KiB
7Wrong answer1.325s59028 KiB
8Wrong answer1.447s59292 KiB
9Wrong answer1.032s59404 KiB
10Wrong answer1.021s59688 KiB
11Time limit exceeded1.549s59980 KiB
subtask30/35
12Wrong answer3ms3884 KiB
13Wrong answer2ms3972 KiB
14Wrong answer3ms3996 KiB
15Wrong answer3ms3972 KiB
16Wrong answer3ms4004 KiB
17Wrong answer4ms4064 KiB
18Wrong answer3ms4000 KiB
19Wrong answer4ms4064 KiB
20Wrong answer6ms4328 KiB
subtask40/45
21Wrong answer9ms4640 KiB
22Wrong answer59ms4208 KiB
23Wrong answer699ms46284 KiB
24Wrong answer167ms4112 KiB
25Wrong answer1.49s60316 KiB
26Wrong answer187ms4104 KiB
27Wrong answer1.098s60592 KiB
28Wrong answer186ms4596 KiB
29Wrong answer1.496s60828 KiB