提交时间:2023-12-16 08:41:34

运行 ID: 116136

#include<bits/stdc++.h> using namespace std; int n,a[100005],ans; int main() { cin>>n; for(int i=1;i<=n;i++) cin>>a[i]; for(int i=2;i<=n;i+=2) ans+=(max(a[i-1],a[i])); cout<<ans/2; return 0; }