Codeforces Round #203 (Div. 2) A.TL

时间:2021-04-29 07:10:59
#include <iostream>
#include <algorithm> using namespace std; int main(){
int n,m;
cin >> n >> m;
int minCorrectTime =, maxCorrectTime = , minWrongTime = ,tmp;
for(int i = ; i < n; i ++){
cin >> tmp;
minCorrectTime = min(tmp,minCorrectTime);
maxCorrectTime = max(tmp,maxCorrectTime);
}
for(int i = ; i < m ; ++ i ){
cin >> tmp;
minWrongTime = min(minWrongTime,tmp);
}
if(maxCorrectTime < minWrongTime && *minCorrectTime < minWrongTime) cout<<max(maxCorrectTime,*minCorrectTime)<<endl;
else cout<<-<<endl;
return ;
}