39652023-03-07 06:19:46AncsaZsonglőrködéscpp11Wrong answer 20/100564ms60628 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<<napok;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer3ms1808 KiB
2Accepted3ms2000 KiB
subtask220/20
3Accepted6ms2788 KiB
4Accepted123ms19356 KiB
5Accepted356ms44924 KiB
6Accepted490ms53472 KiB
7Accepted561ms59160 KiB
8Accepted561ms59288 KiB
9Accepted560ms59420 KiB
10Accepted563ms59536 KiB
11Accepted560ms59528 KiB
subtask30/35
12Accepted3ms3372 KiB
13Wrong answer3ms3648 KiB
14Wrong answer3ms3640 KiB
15Wrong answer3ms3712 KiB
16Wrong answer3ms3860 KiB
17Wrong answer3ms3884 KiB
18Wrong answer3ms3932 KiB
19Wrong answer3ms4004 KiB
20Wrong answer3ms4172 KiB
subtask40/45
21Accepted6ms4600 KiB
22Wrong answer59ms4184 KiB
23Accepted391ms46216 KiB
24Wrong answer168ms4132 KiB
25Accepted564ms60424 KiB
26Wrong answer188ms4136 KiB
27Accepted560ms60240 KiB
28Wrong answer190ms4144 KiB
29Accepted508ms60628 KiB