#include<cstdio>#include<algorithm>using namespace std;const int maxn = 1E5 + 10;int main(){int n,a,b,tmp;a = b = 0;scanf("%d",&n);for(int i = 0 ; i < n ; ++i){scanf("%d",&tmp);if(tmp > a){b += a;a = tmp;}else b += tmp;}int ans = a - b + 1;printf("%d\n",ans);return 0;}
[2016-05-01][codeforces][667B - Coat of Anticubism]
原文:http://www.cnblogs.com/qhy285571052/p/259752a20c81eee15fa2d53539f6a06a.html