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

#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 ;
}
上一篇:Codeforces Round #203 (Div. 2)B Resort


下一篇:Codeforces Round #633 (Div. 2)