#include <cstdio> #include <algorithm> using namespace std; int n,x,mx=-1,ans0; int main() { scanf("%d",&n); for(int i=1; i<=n; i++) { scanf("%d",x); if(x==0) ans0++; mx=max(mx,x); } printf("%d\n",n+mx-ans0); } 看了一下样例,找了个规律,为什么是对的? p11061