Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<vector>
- using namespace std;
- int n;
- int main(){
- cin >> n;
- int m = -1; int sum = 0;
- while (n--){
- int x; cin >> x;
- m = max(m, x);
- sum += x;
- }
- cout << m - (sum - m) + 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment