【求点赞】
2025-09-22 20:46:32
发布于:浙江
1阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
int n,a[N],max1=0,max2=0;
int main(){
cin>>n;
for(int i=1;i<=n;i++)cin>>a[i];
for(int i=1;i<=n;i++){
if(a[i]%20) max1=max(max1,a[i]);
else if (a[i]%2!=0) max2=max(max2,a[i]) ;
}
if(max10||max2==0) cout<<-1;
else cout<<max1+max2;
return 0;
}
这里空空如也
有帮助,赞一个