3965 | 2023-03-07 06:19:46 | Ancsa | Zsonglőrködés | cpp11 | Wrong answer 20/100 | 564ms | 60628 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;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Wrong answer | 3ms | 1808 KiB | ||||
2 | Accepted | 3ms | 2000 KiB | ||||
subtask2 | 20/20 | ||||||
3 | Accepted | 6ms | 2788 KiB | ||||
4 | Accepted | 123ms | 19356 KiB | ||||
5 | Accepted | 356ms | 44924 KiB | ||||
6 | Accepted | 490ms | 53472 KiB | ||||
7 | Accepted | 561ms | 59160 KiB | ||||
8 | Accepted | 561ms | 59288 KiB | ||||
9 | Accepted | 560ms | 59420 KiB | ||||
10 | Accepted | 563ms | 59536 KiB | ||||
11 | Accepted | 560ms | 59528 KiB | ||||
subtask3 | 0/35 | ||||||
12 | Accepted | 3ms | 3372 KiB | ||||
13 | Wrong answer | 3ms | 3648 KiB | ||||
14 | Wrong answer | 3ms | 3640 KiB | ||||
15 | Wrong answer | 3ms | 3712 KiB | ||||
16 | Wrong answer | 3ms | 3860 KiB | ||||
17 | Wrong answer | 3ms | 3884 KiB | ||||
18 | Wrong answer | 3ms | 3932 KiB | ||||
19 | Wrong answer | 3ms | 4004 KiB | ||||
20 | Wrong answer | 3ms | 4172 KiB | ||||
subtask4 | 0/45 | ||||||
21 | Accepted | 6ms | 4600 KiB | ||||
22 | Wrong answer | 59ms | 4184 KiB | ||||
23 | Accepted | 391ms | 46216 KiB | ||||
24 | Wrong answer | 168ms | 4132 KiB | ||||
25 | Accepted | 564ms | 60424 KiB | ||||
26 | Wrong answer | 188ms | 4136 KiB | ||||
27 | Accepted | 560ms | 60240 KiB | ||||
28 | Wrong answer | 190ms | 4144 KiB | ||||
29 | Accepted | 508ms | 60628 KiB |