#include<bits/stdc++.h> #define int long long #define x first #define y second #define MAXN 0x3f3f3f3f3f3f3f3f #define MINN -0x3f3f3f3f3f3f3f3f #define Trubiacy ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); usingnamespace std;
//const int N=+29; int n;
signedmain(){ Trubiacy; // int Tracy=1; int Tracy; cin>>Tracy;//多组输入 while(Tracy--){ cin>>n; int ans=MINN;///由于a[i]的数据范围最小为1,所以ans可以初始化为0 for(int i=1;i<=n;i++){ int x;cin>>x; if(i%2) ans=max(ans,x);//若i为奇数,则a[i]可能是保留到最后的数字,取最大值即可 } cout<<ans<<endl; } return0; }
#include<bits/stdc++.h> #define int long long #define x first #define y second #define MAXN 0x3f3f3f3f3f3f3f3f #define MINN -0x3f3f3f3f3f3f3f3f #define Trubiacy ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); usingnamespace std;
constint N=1e5+29; int n,a[N],ans[N];//代码中数组命名有点乱,a数组为原题中b数组(使用a是因为我习惯输入的数组是a数组),ans为原题中a数组(使用ans是因为此数组为最终需要输出的数组)
#include<bits/stdc++.h> #define int long long #define x first #define y second #define MAXN 0x3f3f3f3f3f3f3f3f #define MINN -0x3f3f3f3f3f3f3f3f #define Trubiacy ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); usingnamespace std;
#include<bits/stdc++.h> #define int long long #define x first #define y second #define MAXN 0x3f3f3f3f3f3f3f3f #define MINN -0x3f3f3f3f3f3f3f3f #define Trubiacy ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); usingnamespace std;