标签:
#include<cstdio>
#include<algorithm>
using namespace std;
const int maxn = 1E5 + 10;
int a[maxn],b[maxn];
int main(){
int n,m;
scanf("%d%d",&n,&m);
int aa =0,bb = 0;
for(int i = 0 ; i < n ; ++i){
scanf("%d",&a[i]);
aa = max(aa, a[i]);
}
for(int j = 0 ; j < m ; ++j){
scanf("%d",&b[j]);
bb = max(bb,b[j]);
}
int t1 = min(min(b[0] , b[m - 1]),aa);
int t2 = min(min(a[0],a[n - 1]),bb);
int t3 = min(a[0],b[m - 1]);
int t4 = min(b[0],a[n - 1]);
printf("%d\n",max(t1,max(t2,max(t3,t4))));
return 0;
}
[2016-04-16][URAL][2069][Hard Rock]
标签:
原文地址:http://www.cnblogs.com/qhy285571052/p/08495e30acae15b137107c4021748a97.html