-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdiemlienke.cpp
More file actions
44 lines (44 loc) · 927 Bytes
/
diemlienke.cpp
File metadata and controls
44 lines (44 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pq priority_queue
#define pii pair<int,int>
#define pll pair<ll,ll>
typedef vector<vector<ll> > vvi;
const ll sized=2000+7;
const ll inf=1e9+7;
const ll MOD=inf;
vector<pii>code;
main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
// freopen("main.inp","r",stdin);
// freopen("main.out","w",stdout);
int n;
cin>>n;
for(int i=0;i<n;i++){
int x;
cin>>x;
code.push_back({x,0});
}
for(int i=0;i<n;i++){
int x;
cin>>x;
code.push_back({x,1});
}
sort(code.begin(),code.end());
int ans=0;
int now=code[0].second;
for(int i=1;i<code.size();i++){
if(code[i].second+now==1)
{
ans++;
now=-1;
}
else now=code[i].second;
}
cout<<ans<<endl;
return 0;
}