よじろめ覚書

私の理解度重視のソースコードです。

ABC117B - Polygon

問題:B - Polygon

#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;

#define REP(i, n) for (int i = 0; i < (n); ++i)

int main(void) {
    int n, l, sum_l = 0, max_l = 0;

    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;
    REP(i, n) {
        cin >> l;
        sum_l += l;
        max_l = max(max_l, l);
    }
    
    cout << (sum_l - max_l > max_l? "Yes" : "No") << "\n";
    return 0;
}