Problem:


Score : 200 points

Problem Statement

Determine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane.

You can use the following theorem:

Theorem: an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.

Constraints

All values in input are integers.

3 \leq N \leq 10

1 \leq L_i \leq 100

Input

Input is given from Standard Input in the following format:

N
L_1 L_2 ... L_N

Output

If an N-sided polygon satisfying the condition can be drawn, print Yes; otherwise, print No.

Sample Input 1

4
3 8 5 1

Sample Output 1

Yes

Since 8 < 9 = 3 + 5 + 1, it follows from the theorem that such a polygon can be drawn on a plane.

Sample Input 2

4
3 8 4 1

Sample Output 2

No

Since 8 \geq 8 = 3 + 4 + 1, it follows from the theorem that such a polygon cannot be drawn on a plane.

Sample Input 3

10
1 8 10 5 8 12 34 100 11 3

Sample Output 3

No



Sample input:
4
3 8 5 1


Sample output:
Yes

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
max=max(l)
cnt=0
c=0
for i in range(n):
    if l[i]==max and cnt==0:
        cnt+=1
    else:
        c+=l[i]
if max<c:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
if 2*max(l)<sum(l):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
t = int(input())
a = list(map(int,input().split()))
lon = max(a)
a.remove(lon)
k = sum(a)

if lon < k :
  print("Yes")
else :
  print("No")

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
x = sorted(L)
Lmax = max(L)
y = x[0:-1]
ysum = sum(y)
print("Yes" if Lmax < ysum else "No")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(N: int, L: "List[int]"):
    L.sort()
    return YES if sum(L[:-1]) > L[-1] else NO


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    L = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    print(solve(N, L))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
mx = max(L)
if sum(L)-mx > mx:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int, input().split()))

max = max(l)
if max < (sum(l) - max):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))

maxlength = max(L)
total = sum(L)
if total > maxlength * 2:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# input
N = int(input())
L = list(map(int, input().split()))

if max(L) < sum(L) - max(L):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
a = int(input())

l = list(map(int, input().split()))
s_l = sorted(l)

big = s_l[a-1]
small = 0

for i in range(a-1):
  small += s_l[i]
if big < small:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int, input().split()))
l.sort(reverse=True)
print('Yes' if max(l) < sum(l[1:]) else 'No')

Submission status: Accepted

Solution code:
N = int(input())
Ls = sorted(map(int, input().split()))
if Ls[-1] < sum(Ls) - Ls[-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
L = sorted(list(map(int, input().split())))
print('Yes' if L[-1] < sum(L[:-1]) else 'No')

Submission status: Accepted

Solution code:
N=int(input())
L=list(map(int,input().split()))
if max(L) < sum(L)-max(L):
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
N=int(input())
L=[int(i) for i in input().split()]
ma=max(L)
sum_=0
ma_index=L.index(ma)
for i in range(N):
  if i!=ma_index:
    sum_=sum_+L[i]
  else:
    pass
if ma<sum_:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n=int(input())

l=[int(x) for x in input().split()]

m=l.pop(l.index(max(l)))

if m<sum(l):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
print('Yes' if sum(L) - max(L) > max(L) else 'No')

Submission status: Accepted

Solution code:
n = int(input())
L = list(map(int, input().split()))
print('Yes' if sum(L)-max(L) > max(L) else 'No')

Submission status: Accepted

Solution code:
n = int(input())
L = list(map(int, input().split()))
print('Yes' if sum(L)-max(L) > max(L) else 'No')

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    l = list(map(int,input().split()))
    if max(l) < sum(l) - max(l):
        print("Yes")
    else:
        print("No")
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    n = int(input())
    a = [int(i) for i in input().split()]
    a.sort(reverse=True)
    if a[0] < sum(a[1:]):
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
N=int(input())
L=sorted(list(map(int, input().split())))
print("Yes" if L[-1]<sum(L[:-1]) else "No")

Submission status: Accepted

Solution code:
# Python3 (3.4.3)
import sys
input = sys.stdin.readline

# -------------------------------------------------------------
# function
# -------------------------------------------------------------


# -------------------------------------------------------------
# main
# -------------------------------------------------------------
N = int(input())
L = list(map(int,input().split()))

maxL = max(L)

print("Yes" if sum(L)-maxL > maxL else "No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
import bisect
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def Yes(): print("Yes"); return
def No(): print("No"); return

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#############
# Main Code #
#############

N = inputI()
l = inputIL()
l.sort()
if sum(l[:-1]) <= l[-1]:
  No()
else:
  Yes()

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    N = int(input())
    L = list(map(int, input().split()))

    max_L = max(L)
    sum_L = sum(L)
    if max_L < sum_L - max_L:
        ans = "Yes"
    else:
        ans = "No"

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
l  = list(map(int, input().split()))
if max(l) < sum(l)-max(l):
    print("Yes")
else: print("No")

Submission status: Accepted

Solution code:
import sys
from fractions import gcd
def input(): return sys.stdin.readline().strip()


def main():
    N = int(input())
    L = list(map(int, input().split()))
    L.sort()
    m = L.pop()
    if m < sum(L): print("Yes")
    else: print("No")

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
n = int(input())
l = list(map(int, input().split()))
m = sum(l)
a = 0
for i in range(n):
    if l[i] >= m - l[i]:
        print("No")
        a = 1
        break
if a == 0:
    print("Yes")

Submission status: Accepted

Solution code:
n = int(input())
l = sorted(list(map(int, input().split())))
p = l.pop()
if p<sum(l):
    print('Yes')
else :
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int,input().split()))
print(['No','Yes'][max(l) <sum(l)-max(l)])

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
temp1=max(l)
temp2=sum(l)-temp1
if temp2>temp1:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
_=input()
L=sorted(list(map(int,input().split())))
print('Yes' if L[-1] < sum(L[:-1]) else 'No')

Submission status: Accepted

Solution code:
n = int(input())
L = list(map(int, input().split()))
if sum(L) > 2 * max(L):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
input()
li = sorted(map(int, input().split()))
print("Yes" if li[-1] < sum(li) - li[-1] else "No")

Submission status: Accepted

Solution code:
N=int(input())
L=list(map(int, input().split()))

a=max(L)
b=sum(L)-a

if a>=b:
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
L.sort()
if L[-1] < sum(L[:-1]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
L_max = max(L)
if sum(L) > 2*L_max:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int, input().split()))
l.sort(reverse = True)
if l[0] < sum(l[1 :]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int, input().split()))
m = max(l)
if  m < sum(l) - m:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def input(): return sys.stdin.readline().rstrip()
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = 10**18
# ----------------------------------------------------------- #

n = I()
L = LI()
if max(L)*2 < sum(L):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int, input().split()))
print("Yes" if max(l) < sum(l) - max(l) else "No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Wed May 13 14:08:20 2020

@author: shinba
"""


n = int(input())

L = list(map(int,input().split()))

L.sort()

M = L.pop()

if M < sum(L):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import sys
# import math
# from string import ascii_lowercase, ascii_upper_case, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from copy import deepcopy                    # to copy multi-dimentional matrix without reference
# from fractions import gcd                    # for Python 3.4 (previous contest @AtCoder)


def main():
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79...e+308
    # inf = 2 ** 64 - 1               # (for fast JIT compile in PyPy) 1.84...e+19
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    n = ii()
    L = lmi()
    print('Yes') if sum(L) - max(L) > max(L) else print('No')


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int, input().split()))
mx = max(l)
rest = sum(l) - mx
if mx < rest:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
l.sort()
#print(l)
sum=sum(l[:len(l)-1])
#print(sum)
if l[-1]<sum:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
a=max(l)
b=sum(l)-a
if a<b:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N=int(input())
L=list(map(int,input().split()))
L_max = L.pop(L.index(max(L)))
L_sum = sum(L)
if L_max < L_sum:
  print('Yes')
else: print('No')

Submission status: Accepted

Solution code:
import sys
import math
import bisect


def main():
    n = int(input())
    A = list(map(int, input().split()))
    if sum(A) - max(A) > max(A):
        print('Yes')
    else:
        print('No')

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())
L = sorted(list(map(int, input().split())))

if L[-1] >= sum(L[:-1]):
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
n=int(input())
L=list(map(int, input().split()))
L=sorted(L)

if sum(L[0:n-1])>L[n-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
L = sorted(list(map(int,input().split())))[::-1]
if L[0] >= sum(L[1:]) :
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
N = int(input())
List = list(map(int, input().split()))
print("Yes" if max(List) < sum(List)-max(List) else "No")

Submission status: Accepted

Solution code:
n = int(input())

s = list(map(int,input().split()))

s.sort()

if s[-1]<sum(s[:-1]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(input())
    l=list(map(int,input().split()))
    l.sort(reverse=True)
    if l[0]<sum(l[1:]):
        print('Yes')
    else:
        print(('No'))
resolve()

Submission status: Accepted

Solution code:
# B - Polygon

N = int(input())
L = list(int(x) for x in input().split())
L.sort(reverse=True)

if L[0] < sum(L[1:]):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n=int(input())
ls=list(map(int,input().split()))
m=0;s=0
for i in range(n):
  if m<ls[i]:
    m=ls[i]
  s+=ls[i]
if m<s-m:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n = int(input())
l = sorted(map(int, input().split()))
ans = 'Yes' if l[-1] < sum(l)-l[-1] else 'No'
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int,input().split()))

if sum(L) > 2*max(L):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N = int(input())
L = list(input().split())
L = [int(L[i]) for i in range(N)]

if max(L) < sum(L) - max(L):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int,input().split()))
max_l = max(L)
sum_l = sum(L)
if max_l < sum_l - max_l:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import numpy as np


N = int(input())
L = list(map(int, input().split()))
maxL = max(L)
argmaxL = np.argmax(L)
L.pop(argmaxL)
if maxL < sum(L):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n = int(input())
li = list(map(int,input().split()))
if max(li) < sum(li)-max(li):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
L_list = list(map(int, input().split()))

if max(L_list) * 2 < sum(L_list):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int, input().split()))
max_l = max(l)
if sum(l)-max_l > max_l:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
L = [int(i) for i in input().split()]

print('Yes' if max(L) < (sum(L) - max(L)) else 'No')

Submission status: Accepted

Solution code:
import itertools
import math

n = int(input())
l = list(map(int, input().split()))

maxi_idx = l.index(max(l))
sum = 0
for i in range(n):
    if i != maxi_idx:
        sum += l[i]

if sum > max(l):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
L = [int(i) for i in input().split()]

if max(L) < sum(L) - max(L):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n=int(input())
lst = list(map(int,input().split()))
long=max(lst)
lst.remove(long)
if sum(lst)>long:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n=int(input())
L=list(map(int,input().split()))

if sum(L)-max(L)>max(L):
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
most = max(L)
if 2*most < sum(L):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
ls = [int(i) for i in input().split()]
max_ = max(ls)
if max_ < sum(ls) - max_:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
input();v=sorted(map(int,input().split()));print("YNeos"[v[-1]>=sum(v[:-1])::2])

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int, input().split()))

mx = max(l)
if mx < sum(l) - mx:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n=int(input())
L=list(map(int,input().split()))
sum=0
max=0
for i in L:
    if i>max:
        sum+=max
        max=i
    else:
        sum+=i
if max<sum:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int,input().split()))
if max(l) < (sum(l)-max(l)):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))

print("Yes" if max(a) < sum(a)-max(a) else "No")

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int,input().split()))

l.sort()

if l[-1] < sum(l) - l[-1]:
	print('Yes')
else:
	print('No')

Submission status: Accepted

Solution code:
n = int(input())
m = sorted(map(int, input().split()))
print('Yes' if m[-1] < sum(m[:-1]) else 'No')

Submission status: Accepted

Solution code:
n = int(input())
ar = list(map(int,input().split()))
l = max(ar)
if 2*l < sum(ar):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N=int(input())
L=list(map(int,input().split()))
if max(L)<(sum(L)-max(L)):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
l_list = sorted([int(x) for x in input().split()], reverse=True)
print("Yes" if l_list[0] * 2 < sum(l_list) else "No")

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))

if max(L) < sum(L) - max(L):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
ii = lambda:int(input())
mi = lambda:list(map(int,input().split()))
ix = lambda x:list(input() for _ in range(x))
mix = lambda x:list(mi() for _ in range(x))
iix = lambda x:list(int(input()) for _ in range(x))
##########
def main(n,l):
    maxval = max(l)
    th = sum(l) - maxval
    return "Yes" if maxval < th else "No"

n = ii()
l = mi()
print(main(n,l))

Submission status: Accepted

Solution code:
n = int(input())
l_list = list(map(int,input().split()))
c = 0
for hoge in l_list:
  c += hoge
e = 0
for poge in l_list:
  if c-poge <= poge:
    e += 1
if e == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
ma=l[0]
s=0
for i in range(n):
    s+=l[i]
    if l[i]>ma:
        ma=l[i]
if s-ma>ma:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n=int(input())
lis=list(map(int,input().split()))
print("Yes" if max(lis)<(sum(lis)-max(lis)) else "No")

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
print("Yes") if sum(l)>2*max(l) else print("No")

Submission status: Accepted

Solution code:
n = int(input())
l = [int(i) for i in input().split()]
l.sort(reverse=True)
a = l.pop(0)
if a < sum(l):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int, input().split()))
if 2*max(l) < sum(l):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int, input().split()))
if 2*max(l) < sum(l):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))

if sum(l)-max(l) > max(l):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans=0
#print(a_max)
for i in a:
    ans+=i
if ans-max(a)<=max(a):
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
n = int(input())
L = list(map(int,input().split()))
kekka = 0
for i in range(n):
  if 2*L[i] >= sum(L):
    kekka = 1
    break
    
if kekka == 1:
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
mli = L.index(max(L))
if L[mli] < sum(L[:mli]+L[mli+1:]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
L.sort()

if L[len(L)-1] < sum(L[:len(L)-1]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n=int(input())
L=sorted(list(map(int,input().split())))[::-1]
print('Yes' if L[0]<sum(L[1:]) else 'No')

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
m=max(l)
l.remove(m)
print('Yes' if m<sum(l) else 'No')

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
from copy import deepcopy
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
inf = 10**17
mod = 10**9 + 7
#s=input().rstrip()

n=I()
l=sorted(LI(),reverse=True)
if sum(l)>2*l[0]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int, input().split()))
l.sort(reverse=True)
if l[0] < sum(l[1:]):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
l.sort()
if sum(l[0:n-1])>l[n-1]:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
s = int(input())
n = list(map(int,(input().split())))
n = sorted(n)
if n[-1] < sum(n)-n[-1]:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n = int(input()) 
l = sorted(list(map(int, input().split())))
print("Yes") if l[-1] < sum(l[:-1]) else print("No")

Submission status: Accepted

Solution code:
n=int(input())
l = [int(_) for _ in input().split()]
print('Yes' if max(l)<sum(l)-max(l) else 'No')

Submission status: Accepted

Solution code:
n=int(input())
l=sorted(list(map(int,input().split())))
if l[-1]<sum(l[:n-1]):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
List = list(map(int,input().split()))
if max(List) < sum(List)-max(List):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
L = list(map(int,input().split()))
print('Yes' if sum(L)-2*max(L) > 0 else 'No')

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
a=max(l)
l.remove(a)
if a<sum(l):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int,input().split()))
sum_l = sum(l)
print('Yes' if all([sum_l-i > i for i in l]) else 'No')

Submission status: Accepted

Solution code:
n = int(input())
l = [int(i) for i in input().split()]
if 2*max(l) < sum(l):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int,input().split()))

l.sort(reverse=True)
ans =0
for i in range(1,n):
    ans+=l[i]

if ans > l[0]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
L = list(map(int, input().split()))
idx = L.index(max(L))
sum_L = 0
for i in range(len(L)):
    if i == idx:
        pass
    else:
        sum_L += L[i]

if L[idx] < sum_L:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
max_= max(l)
if sum(l)>2*max_:
	print('Yes')
else:
	print('No')

Submission status: Accepted

Solution code:
input()
A = list(map(int,input().split()))
print('Yes' if max(A) < sum(A)/2 else 'No')

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int, input().split()))
if max(l) < sum(l)-max(l):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n = int(input())
l = list(map(int,input().split()))
l.sort()
l_max = l[-1]
ans = 1
s = sum(l) - l_max
if s > l_max:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
a = sorted(list(map(int, input().split())))
if sum(a) > 2 * a[-1]:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N = int(input())
l = list(map(int, input().split()))

num = l.pop(l.index(max(l)))
if num < sum(l):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = input()
data = list(map(int, input().split()))

max = max(data)

sum = sum(data)

flag = sum - max
if (max < flag):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
l = map(int, input().split())
l = sorted(l)
if l[-1] < sum(l[:-1]):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
#template
def inputlist(): return [int(k) for k in input().split()]
#template
N = int(input())
L = inputlist()
L.sort()
s=sum(L)
s -=L[-1]
if L[-1] < s:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
l.sort()
l.reverse()
max=l[0]
sum=0
for i in range(1,n):
    sum+=l[i]
if max<sum:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
li = input().split()
lis = [int(x) for x in li ]
a = sum(lis)
m = max(lis)
a -=m
if m < a:
	print('Yes')
else:
	print('No')

Submission status: Accepted

Solution code:
n = int(input())
arr = list(map(int,input().split()))
arr.sort()
longest = arr[-1]
sonota = sum(arr)-longest
if longest<sonota:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:


def solve():

    N = int(input())
    Llist = list(map(int, input().split()))

    MAX = max(Llist)

    if MAX < sum(Llist)-MAX:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    solve()