提交时间:2022-04-10 11:20:55
运行 ID: 48162
#include<bits/stdc++.h> using namespace std; #define N 105 int n,a[N]; #undef N int main(){ std::ios::sync_with_stdio(0); cin.tie(0);cout.tie(0); cin>>n; for(int i(1);i<=n;++i) cin>>a[i]; cout<<(n&1?max(a[1],a[n]):min(a[1],a[n]))<<endl; return 0; }