-
-
Save enzerr/6b5d57b32783841a5c93c36046f48a83 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<bits/stdc++.h> | |
using namespace std; | |
#define pii pair<int,int> | |
#define ff first | |
#define ss second | |
#define all(x) x.begin(),x.end() | |
int main(){ | |
int a, b; cin >> a >> b; | |
vector<pii> v; | |
for(int i = 0; i < a; i++){ | |
int x; cin >> x; | |
v.push_back({x,0}); | |
} | |
for(int i = 0; i < b; i++){ | |
int x; cin >> x; | |
v.push_back({x,1}); | |
} | |
sort(all(v), greater<pii>()); | |
for(int i = 1; i < v.size(); i++){ | |
if(v[i].ss!=v[0].ss){ | |
cout << i-1 << '\n'; | |
break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment