#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 #198 (Div. 1) D. Iahub and Xors 二维树状数组*
- Educational Codeforces Round 143 (Rated for Div. 2) A-E
- Codeforces Round #434 (Div. 2, based on Technocup 2018 Elimination Round 1)&&Codeforces 861C Did you mean...【字符串枚举,暴力】
- Codeforces Round #343 (Div. 2) C. Famil Door and Brackets
- Codeforces Round #851 (Div. 2) A-E
- Codeforces Round #284 (Div. 2) C题(计算几何)解题报告
- Codeforces Round #446 (Div. 2) C. Pride【】
- Codeforces Round #520 (Div. 2) A. A Prank 好题
- Codeforces Round #521 (Div. 3) D. Cutting Out 好题字符串
- Codeforces Round #521 (Div. 3) C. Good Array