11795 | 2024-11-11 10:51:13 | almadav | Zsonglőrködés | cpp17 | Accepted 100/100 | 574ms | 28672 KiB |
#include <bits/stdc++.h>
using namespace std;
int main()
{
/*cin.tie(0);
iostream::sync_with_stdio(0);*/
unordered_map<int,int> eleje;
unordered_map<int,int> vege;
int n;
int minusz = 0;
int kezd, fejez;
cin>>n;
for(int i = 0; i < n; i++)
{
cin >> kezd >> fejez;
eleje[kezd]++;
vege[fejez]++;
}
for(pair<int,int> x : eleje)
{
minusz += min(eleje[x.first],vege[x.first]);
}
cout<<n-minusz;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 1ms | 320 KiB | ||||
2 | Accepted | 1ms | 320 KiB | ||||
subtask2 | 20/20 | ||||||
3 | Accepted | 4ms | 568 KiB | ||||
4 | Accepted | 101ms | 7864 KiB | ||||
5 | Accepted | 365ms | 18500 KiB | ||||
6 | Accepted | 528ms | 27912 KiB | ||||
7 | Accepted | 458ms | 28548 KiB | ||||
8 | Accepted | 472ms | 28548 KiB | ||||
9 | Accepted | 574ms | 28548 KiB | ||||
10 | Accepted | 437ms | 28548 KiB | ||||
11 | Accepted | 574ms | 28548 KiB | ||||
subtask3 | 35/35 | ||||||
12 | Accepted | 1ms | 320 KiB | ||||
13 | Accepted | 1ms | 508 KiB | ||||
14 | Accepted | 1ms | 320 KiB | ||||
15 | Accepted | 1ms | 320 KiB | ||||
16 | Accepted | 1ms | 320 KiB | ||||
17 | Accepted | 1ms | 320 KiB | ||||
18 | Accepted | 1ms | 320 KiB | ||||
19 | Accepted | 1ms | 320 KiB | ||||
20 | Accepted | 1ms | 320 KiB | ||||
subtask4 | 45/45 | ||||||
21 | Accepted | 4ms | 568 KiB | ||||
22 | Accepted | 56ms | 508 KiB | ||||
23 | Accepted | 296ms | 18448 KiB | ||||
24 | Accepted | 168ms | 404 KiB | ||||
25 | Accepted | 518ms | 28632 KiB | ||||
26 | Accepted | 182ms | 320 KiB | ||||
27 | Accepted | 465ms | 28548 KiB | ||||
28 | Accepted | 187ms | 320 KiB | ||||
29 | Accepted | 467ms | 28672 KiB |