3964 | 2023-03-07 06:16:20 | Ancsa | Zsonglőrködés | cpp11 | Wrong answer 0/100 | 1.549s | 60828 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;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Wrong answer | 3ms | 1808 KiB | ||||
2 | Wrong answer | 3ms | 2060 KiB | ||||
subtask2 | 0/20 | ||||||
3 | Wrong answer | 14ms | 2756 KiB | ||||
4 | Wrong answer | 252ms | 19288 KiB | ||||
5 | Wrong answer | 930ms | 44820 KiB | ||||
6 | Wrong answer | 1.332s | 53468 KiB | ||||
7 | Wrong answer | 1.325s | 59028 KiB | ||||
8 | Wrong answer | 1.447s | 59292 KiB | ||||
9 | Wrong answer | 1.032s | 59404 KiB | ||||
10 | Wrong answer | 1.021s | 59688 KiB | ||||
11 | Time limit exceeded | 1.549s | 59980 KiB | ||||
subtask3 | 0/35 | ||||||
12 | Wrong answer | 3ms | 3884 KiB | ||||
13 | Wrong answer | 2ms | 3972 KiB | ||||
14 | Wrong answer | 3ms | 3996 KiB | ||||
15 | Wrong answer | 3ms | 3972 KiB | ||||
16 | Wrong answer | 3ms | 4004 KiB | ||||
17 | Wrong answer | 4ms | 4064 KiB | ||||
18 | Wrong answer | 3ms | 4000 KiB | ||||
19 | Wrong answer | 4ms | 4064 KiB | ||||
20 | Wrong answer | 6ms | 4328 KiB | ||||
subtask4 | 0/45 | ||||||
21 | Wrong answer | 9ms | 4640 KiB | ||||
22 | Wrong answer | 59ms | 4208 KiB | ||||
23 | Wrong answer | 699ms | 46284 KiB | ||||
24 | Wrong answer | 167ms | 4112 KiB | ||||
25 | Wrong answer | 1.49s | 60316 KiB | ||||
26 | Wrong answer | 187ms | 4104 KiB | ||||
27 | Wrong answer | 1.098s | 60592 KiB | ||||
28 | Wrong answer | 186ms | 4596 KiB | ||||
29 | Wrong answer | 1.496s | 60828 KiB |