3187 | 2023-02-21 19:24:40 | balaaaazs | Zsonglőrködés | cpp14 | Wrong answer 0/100 | 449ms | 45320 KiB |
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
bool eszerint(pair<int, int> p1, pair<int, int> p2)
{
if(p1.first==p2.first)
return p1.second<p2.second;
else
return p1.first<p2.first;
}
int main()
{
int n;
cin>>n;
vector<pair<int, int>> v(n);
for(int i=0;i<n;i++)
cin>>v.at(i).first>>v.at(i).second;
map<int, int> k;
int tot = n;
for (int i = 0; i < n; i++)
{
if (k[v[i].first] > 0)
{
k[v[i].first]--;
tot--;
}
k[v[i].second]++;
}
cout << tot << endl;
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Wrong answer | 3ms | 1808 KiB | ||||
2 | Accepted | 3ms | 2056 KiB | ||||
subtask2 | 0/20 | ||||||
3 | Accepted | 4ms | 2804 KiB | ||||
4 | Accepted | 104ms | 14556 KiB | ||||
5 | Wrong answer | 289ms | 33100 KiB | ||||
6 | Accepted | 361ms | 39452 KiB | ||||
7 | Accepted | 409ms | 43564 KiB | ||||
8 | Accepted | 407ms | 43776 KiB | ||||
9 | Accepted | 407ms | 43736 KiB | ||||
10 | Accepted | 439ms | 44008 KiB | ||||
11 | Wrong answer | 449ms | 43992 KiB | ||||
subtask3 | 0/35 | ||||||
12 | Accepted | 3ms | 3688 KiB | ||||
13 | Wrong answer | 3ms | 3804 KiB | ||||
14 | Wrong answer | 3ms | 3820 KiB | ||||
15 | Wrong answer | 3ms | 3996 KiB | ||||
16 | Wrong answer | 3ms | 4224 KiB | ||||
17 | Wrong answer | 3ms | 4368 KiB | ||||
18 | Wrong answer | 3ms | 4504 KiB | ||||
19 | Wrong answer | 3ms | 4380 KiB | ||||
20 | Wrong answer | 3ms | 4380 KiB | ||||
subtask4 | 0/45 | ||||||
21 | Accepted | 4ms | 4916 KiB | ||||
22 | Wrong answer | 57ms | 5240 KiB | ||||
23 | Wrong answer | 305ms | 35148 KiB | ||||
24 | Wrong answer | 167ms | 7536 KiB | ||||
25 | Wrong answer | 446ms | 45320 KiB | ||||
26 | Wrong answer | 188ms | 7824 KiB | ||||
27 | Wrong answer | 441ms | 45160 KiB | ||||
28 | Wrong answer | 186ms | 7728 KiB | ||||
29 | Wrong answer | 439ms | 45288 KiB |