10628 | 2024-04-07 00:14:35 | 111 | Zsonglőrködés | cpp17 | Accepted 100/100 | 435ms | 108408 KiB |
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N;
cin>>N;
map<int,int>m;
for(int i=0;i<N;i++){
int a,b;
cin>>a>>b;
m[a]--;
m[b]++;
}
int x=0;
for(auto[a,b]:m){
x+=max(b,0ll);
}
cout<<x<<'\n';
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1952 KiB | ||||
2 | Accepted | 3ms | 1972 KiB | ||||
subtask2 | 20/20 | ||||||
3 | Accepted | 4ms | 2832 KiB | ||||
4 | Accepted | 78ms | 18772 KiB | ||||
5 | Accepted | 250ms | 44600 KiB | ||||
6 | Accepted | 321ms | 55544 KiB | ||||
7 | Accepted | 433ms | 64784 KiB | ||||
8 | Accepted | 368ms | 68756 KiB | ||||
9 | Accepted | 365ms | 72552 KiB | ||||
10 | Accepted | 367ms | 76624 KiB | ||||
11 | Accepted | 365ms | 80516 KiB | ||||
subtask3 | 35/35 | ||||||
12 | Accepted | 3ms | 30592 KiB | ||||
13 | Accepted | 3ms | 30604 KiB | ||||
14 | Accepted | 3ms | 30728 KiB | ||||
15 | Accepted | 3ms | 30804 KiB | ||||
16 | Accepted | 3ms | 30928 KiB | ||||
17 | Accepted | 3ms | 30960 KiB | ||||
18 | Accepted | 3ms | 30932 KiB | ||||
19 | Accepted | 3ms | 30992 KiB | ||||
20 | Accepted | 3ms | 31000 KiB | ||||
subtask4 | 45/45 | ||||||
21 | Accepted | 4ms | 31460 KiB | ||||
22 | Accepted | 21ms | 32160 KiB | ||||
23 | Accepted | 252ms | 72576 KiB | ||||
24 | Accepted | 63ms | 38604 KiB | ||||
25 | Accepted | 435ms | 92644 KiB | ||||
26 | Accepted | 68ms | 46496 KiB | ||||
27 | Accepted | 374ms | 100284 KiB | ||||
28 | Accepted | 68ms | 54232 KiB | ||||
29 | Accepted | 370ms | 108408 KiB |