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())
sides = [int(x) for x in input().split()]
tot = sum(sides)

for i in sides:
  if tot - i <= i:
    print('No')
    break
else:
  print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(len(l)):
    if l[i] >= sum(l[:i]) + sum(l[i+1:]):
        print('No')
        exit()

print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
L = LIST()

MAX = max(L)
SUM = sum(L)

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

Submission status: Accepted

Solution code:
inf = 10**9+7
mod = 10**9+7
n = int(input())
a = list(map(int, input().split()))
maxa = max(a)
a.remove(maxa)
if maxa < sum(a):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

for i in l:
    if i < sum(l)-i:
        pass
    else:
        print ("No")
        exit ()
print ("Yes")

Submission status: Accepted

Solution code:
def Polygon(n, ll):

    return "Yes" if max(ll) < sum(ll)-max(ll) else "No"

def main():
    n = int(input())
    ll = list(map(int, input().split()))
    print(Polygon(n, ll))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
L = lr(); L.sort()
bl = L[-1] < sum(L[:-1])
print('Yes' if bl else 'No')

Submission status: Accepted

Solution code:
def main():
    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

    #inf = 10**17
    #mod = 10**9 + 7

    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:

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

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

Submission status: Accepted

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

max_L = max(L)
sum_excluded_max_L = sum(L) - max_L

answer = 'Yes' if max_L < sum_excluded_max_L else 'No'

print(answer)

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.readline

def main():
    N = int(input())
    L = list(map(int, readline().rstrip().split()))
    if max(L) < sum(L) - max(L):
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    *a, = map(int, input().split())

    ma = max(a)
    s = sum(a)
    cond = ma - (s - ma) < 0
    print('Yes' if cond else 'No')


if __name__ == '__main__':
    main()

# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())

Submission status: Accepted

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

Submission status: Accepted

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

li.sort()

if sum(li[:-1]) > li[-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) > 2 * l[n - 1]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from heapq import heapify, heappop, heappush

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
L = LIST()

l = sorted(L)
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()))
if sum(l) - max(l) > max(l):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# Problem B - Polygon

# input
N = int(input())
l_nums = list(map(int, input().split()))

# initialization
is_ok = True

# check
for i in range(N):
    check_sum = 0
    for j in range(N):
        if i==j:
            continue
        check_sum += l_nums[j]
    if l_nums[i]>=check_sum:
        is_ok = False

# output
if is_ok:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

ll = sorted(ll, reverse=True)

if sum(ll[1:]) > ll[0]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.buffer.readline().split()]
def I(): return int(sys.stdin.buffer.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n = I()
    l = LI()
    s = sum(l)
    m = max(l)
    if 2*m < s:
        print("Yes")
    else:
        print("No")
    return

#Solve
if __name__ == "__main__":
    solve()

Submission status: Accepted

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

if max(l)*2 >=sum(l):
  print("No")
  exit()
print("Yes")

Submission status: Accepted

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

flag = True if sum(L[:-1]) > L[-1] else False

if flag:
    print('Yes')
else:
    print('No')

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()))
x = max(l)
if sum(l)-x>x:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def resolve():
  n = int(input())
  l = list(map(int, input().split()))
  l.sort()
  sum = 0
  for i in range(n-1):
    sum += l[i]

  if sum > l[n-1]:
    print("Yes")
  else:
    print("No")
  return

if __name__ == "__main__":
  resolve()

Submission status: Accepted

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

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()))
l.sort()
ml = l[-1]
s = sum(l[:n-1])
if ml < s:print('Yes')
else:print('No')

Submission status: Accepted

Solution code:
N = int(input())
Ln = list(map(int,input().split(' ')))
max_num = 0
sum_num = 0
for l in Ln:
    sum_num += l
    max_num = max(max_num,l)
if sum_num - max_num > max_num:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from heapq import heappush, heappop
from itertools import permutations, accumulate, combinations
import math
import bisect
import numpy as np
from collections import defaultdict, deque
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)
# MOD = 10 ** 9 + 7
# INF = float("inf")


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
    n = int(input())
    l = list(map(int, input().split()))
    l = sorted(l)
    maxl = l[-1]
    if sum(l[:len(l)-1]) >maxl:
        print("Yes")
    else:
        print("No")
resolve()

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(map(int,input().split()))
l.sort()
lmax=l[-1]
lsum=sum(l[:n-1])
if lmax<lsum:print("Yes")
else:print("No")

Submission status: Accepted

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

Submission status: Accepted

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

M = max(A)
if M < sum(A)-M:
    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(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(map(int, input().split()))

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

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    l = [int(x) for x in input().split()]
    all_l = sum(l)
    l.sort()
    print("Yes" if all(l[-1] < all_l - l[-1] for i in range(n)) else "No")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def examA():
    N = I()
    L = LI()
    L.sort()
    if sum(L)<=L[-1]*2:
        print("No")
    else:
        print("Yes")
    return

def examB():
    ans = 0
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(readline())
def LI(): return list(map(int,readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examA()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    L = [int(a) for a in input().split()]
    lmax = max(L)
    L.remove(lmax)
    if sum(L) > lmax :
        print("Yes")
    else:
        print("No")
main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = 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()))
ans = 'Yes' if 2 * max(L) < sum(L) else 'No'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC 117: B – Polygon
N = int(input())
L = [int(s) for s in input().split()]

print('Yes' if max(L) < sum(L) - max(L)  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:
# solution

data = int(input())
array = list(map(int, input().split()))
one=max(array)
two=sum(array)-one
print("Yes" if two>one else "No")

Submission status: Accepted

Solution code:
import numpy as np
N= int(input())
L=[int(x) for x in input().split()]

L_max=np.max(L)
L_sum=sum(L)-L_max

if L_sum > L_max:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

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

ind = np.argmax(L)
maxL = L.pop(ind)

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

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int, input().split()))
ma = max(l)
l.remove(ma)
lsu = sum(l)

if lsu>ma:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
L = [int(x) for x in 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()))
if max(L) * 2 < sum(L):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
#!/usr/bin/python3
 
cmdvar_N=int(input())
cmdvar_numlist=input()
cmdvar_numlist_splited=[int(s) for s in cmdvar_numlist.split()]
sum=0

if cmdvar_N != len(cmdvar_numlist_splited):
    print("error")
    exit(-1)

cmdvar_numlist_splited.sort(reverse=True)
#print(cmdvar_numlist_splited)
top_max_number=cmdvar_numlist_splited[0]

for List in cmdvar_numlist_splited:
    sum=int(sum)+int(List)

if int(top_max_number) < sum-int(top_max_number):
    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=input()
l=list(map(int,input().split()))
print("Yes" if 2*max(l)<sum(l) else "No")

Submission status: Accepted

Solution code:
n=input()
l=list(map(int,input().split()))
print("Yes" if max(l)<sum(l)-max(l) else "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:
import numpy as np
import sys

n = int(input())
l = np.array([int(x) for x in input().split()])
if np.max(l) * 2 < np.sum(l):
	print("Yes")
else:
	print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

max_suffix = 0
for i in range(n):
    if l[max_suffix] < l[i]: max_suffix = i

total = 0
for i in range(n):
    if i == max_suffix: continue
    else: total += l[i]
    
if total > l[max_suffix]: print("Yes")
else: print('No')

Submission status: Accepted

Solution code:
import sys
import os
import math

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    L = sorted(il())[::-1]
    print('Yes' if sum(L[:1]) < sum(L[1:]) else 'No')



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:
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(map(int,input().split()))
l=sorted(l,reverse=True)
cou=sum(l)-l[0]

if l[0]<cou:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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())
N=list(map(int,input().split()))

max_n=max(N)
N.remove(max_n)
print("Yes" if max_n<sum(N) else "No")

Submission status: Accepted

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

Submission status: Accepted

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

sum = 0

for i in range(N):
    sum += Ls[i]

if max(Ls)*2 < sum:
    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:
# from math import factorial,sqrt,ceil
# from itertools import permutations as permus
# from fractions import gcd
# from collections import deque,Counter
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson
# from scipy.sparse import csr_matrix

# strlist = "abcdefghijklmnopqrstuvwxyz"
n = int(input())
arrL = list(map(int,input().split()))

longest = max(arrL)
hokasum = sum(arrL) - longest

if longest<hokasum:
    ans = "Yes"
else:
    ans = "No"

print(ans)
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する
# print("{:.10f}".format(ans))
# print("{:0=10d}".format(ans))

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()))

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

Submission status: Accepted

Solution code:
import sys
N = int(sys.stdin.readline().rstrip())
l = list(map(int, sys.stdin.readline().rstrip().split()))
 
lm = 0
L = 0
for n in range(N):
  if l[n] > lm:
    L += lm
    lm = l[n]
  else:
    L += l[n]
    
if lm < L:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

    return N,L

def check(N,L):
    sum =0 

    for n in range(N-1):
        sum += L[n]
    if sum > L[N-1]:
        print("Yes")
    else:
        print("No")
    



N,L =nyu()
check(N,L)

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int, input().split()))
l.sort()
a=l.pop()
t=0
for i in range(len(l)):
  t+=l[i]
if a<t:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N,L=open(0);L=sorted(map(int,L.split()));print('YNeos'[sum(L[:-1])<=L[-1]::2])

Submission status: Accepted

Solution code:
n=int(input())
L=list(sorted(map(int,input().split())))
m=L[-1]
if sum(L)>2*m:
    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()))
if max(a)*2 < sum(a):
  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:
n=input()
L=sorted(list(map(int,input().split())))
if sum(L[:-1])>L[-1]:print("Yes")
else:print("No")

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=[int(i) for i in input().split()]
L.sort()
Lng=L.pop()
if Lng < sum(L):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n=int(input())
l=[int(i) for i in input().split()]
l.sort()

longest=l.pop()
remain=sum(l)
if longest<remain:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

l.sort()

max_num = l.pop(-1)

if max_num < sum(l):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

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(map(int,input().split()))
L2=sorted(L)
length2=sum(L2[:-1])
if length2>L2[-1]:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n = int(input())
L = list(map(int,input().split()))
for l in L:
  if sum(L) - l <= l:
    print('No')
    exit()
print('Yes')

Submission status: Accepted

Solution code:
a = int(input())
b = input().split()
b_list = []
for i in range(a):
    b_list.append(int(b[i]))
c = max(b_list)
if sum(b_list)-c * 2>0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
a = int(input())
b = [int(i) for i in input().split(" ")]
Max = max(b)
c = -Max
for i in range(a):
    c+=b[i]
 
if Max<c:
    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(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()))
x=max(L)
sum=0
i=0
for i in range(N):
  sum+=L[i]
  i+=1
y=sum-x
if x<y:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

n = readline()
l = list(map(int, readline().split()))
print('Yes' if sum(l) > 2 * max(l) else 'No')

Submission status: Accepted

Solution code:
N = int(input())
L = [int(i) for i in input().split()]
l = max(L)
L.remove(l)
if sum(L) > l:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
_ = input()
*l, m = sorted(map(int, input().split()))
print("Yes" if sum(l) > m else "No")

Submission status: Accepted

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

if 2*max(List) < sum(List):
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
n=int(input())
l=[int(i) for i in 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()))
L.sort(reverse=True)
total=0
for i in range(1,N):
  total+=L[i]
if L[0]<total:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
#ABC-118-B
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:
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
l = LI()
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()))
if sum(l)>2*max(l):
  print("Yes")
else:
  print("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:
n = int(input())

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

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

Submission status: Accepted

Solution code:
#template
from collections import Counter
def inputlist(): return [int(j) for j in input().split()]
#template
N = int(input())
L = inputlist()
L.sort()
s = 0
for i in range(N-1):
    s += L[i]
if s > L[-1]:
    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)/2 else "No")

Submission status: Accepted

Solution code:
#
# Written by NoKnowledgeGG @YlePhan
# ('ω')
#
#import math
#mod = 10**9+7
#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""
 
def main():
  n = int(input())
  L = list(map(int,input().split()))
  
  L = sorted(L,reverse=True)
  if L[0] < sum(L[1:]):
    print('Yes')
  else:
    print('No')
  
if __name__ == '__main__':
  main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

maxedge = max(lst)
lst.remove(maxedge)
if maxedge < sum(lst):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
  n = int(input())
  #s = input()
  #s = input().split()
  l = list(map(int,input().split()))
  #a = [input() for i in range(n)]
  #a = [int(input()) for i in range(n)]
  #a = [input().split() for i in range(n)]
  #a = [list(map(int,input().split())) for i in range(n)]
  ans = 0
  count = 0
  lis = []
  
  lis = sorted(l)
  
  for i in range(n):
    if i == n-1:
      if ans > lis[i]:
        print("Yes")
      else:
        print("No")
    else:    
      ans += lis[i]

if __name__ == '__main__':
  main()