#include<bits/stdc++.h>
using namespace std;
#define max(x,y) ((x)>(y)?(x):(y))
int main()
{
int n,ans=0,max=-10086,ans1=0,ans2=0;
int sum;
scanf("%d", &n);
int arr[n];
for(int i=0;i<n;i++)
{
scanf("%d", &arr[i]);
ans+=arr[i];
if(arr[i]>max)
max=arr[i];
}
ans1=ans+n;
ans2=ans-max+max*n;
sum=max(max(ans1,ans2),ans);
printf("%d\n",sum);
return 0;
}
【HUT OJ】两难抉择
最新推荐文章于 2024-09-10 15:28:21 发布