#include <cstdio>
#include <algorithm>
#include <set>
using namespace std;
int a[10000];
int main(){
int n, i, t;
set<int> st;
while(scanf("%d", &n) == 1){
for(i = 1; i <= n; ++i)
scanf("%d", &a[i]);
for(i = t = 1; i < n; i += 3)
if(t) st.insert(*max_element(a + i, a + i + 3)), t = 0;
else st.insert(*min_element(a + i, a + i + 3)), t = 1;
printf("%d\n", *st.rbegin());
st.clear();
}
return 0;
}
800482 | 长木 | 变态最大值 | Accepted | 12 | 344 | C/C++ | 04-07 14:49:31 |