2011年408真题 (暴力)
#include <iostream>
const int N = 10010;
using namespace std;
int a[N], b[N];
int n;
int find_mid(int a[], int b[], int n)
{
int i = 0, j = 0;
while( i + j < n - 1)
{
if(a[i] <= b[j])
{
i ++;
}else
{
j ++;
}
}
return a[i] <= b[j] ? a[i] : b[j];
}
int main()
{
cin >> n;
for(int i = 0;i < n; i ++) cin >> a[i];
for(int j = 0;j < n; j ++) cin >> b[j];
cout << find_mid(a, b, n);
return 0;
}