106282024-04-07 00:14:35111Zsonglőrködéscpp17Accepted 100/100435ms108408 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;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1952 KiB
2Accepted3ms1972 KiB
subtask220/20
3Accepted4ms2832 KiB
4Accepted78ms18772 KiB
5Accepted250ms44600 KiB
6Accepted321ms55544 KiB
7Accepted433ms64784 KiB
8Accepted368ms68756 KiB
9Accepted365ms72552 KiB
10Accepted367ms76624 KiB
11Accepted365ms80516 KiB
subtask335/35
12Accepted3ms30592 KiB
13Accepted3ms30604 KiB
14Accepted3ms30728 KiB
15Accepted3ms30804 KiB
16Accepted3ms30928 KiB
17Accepted3ms30960 KiB
18Accepted3ms30932 KiB
19Accepted3ms30992 KiB
20Accepted3ms31000 KiB
subtask445/45
21Accepted4ms31460 KiB
22Accepted21ms32160 KiB
23Accepted252ms72576 KiB
24Accepted63ms38604 KiB
25Accepted435ms92644 KiB
26Accepted68ms46496 KiB
27Accepted374ms100284 KiB
28Accepted68ms54232 KiB
29Accepted370ms108408 KiB