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())
li = list(map(int,input().split()))

total=0
for i in range(n):
    total+=li[i]

if max(li)<total-max(li):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
list_l = list(map(int, input().split()))
max_l = max(list_l)
list_l.remove(max_l)
if max_l < sum(list_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:
import math

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 sys

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

m = max(l)
s = sum(l)

if s - m > m:
    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) else 'No')

Submission status: Accepted

Solution code:
n = int(input())
*l, = sorted(map(int, input().split()), reverse=True)

print("Yes" if l[0] < sum(l[1:]) else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int, input().split()))
Max = max(l)
Max_index = l.index(max(l))
l[Max_index] = 0
if Max < sum(l):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int, input().split()))
check = True
for i in range(n):
    if l[i] >= sum(l) - l[i]:
        check = False
if check:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def examA():
    T, X = LI()
    ans = T/X
    print(ans)
    return

def examB():
    N = I()
    L = LI()
    ans = "Yes"
    if max(L)*2>=sum(L):
        ans = "No"
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.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()
mod = 10**9 + 7
inf = float('inf')

if __name__ == '__main__':
    examB()

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int, input().split()))
s = max(l)
del l[l.index(max(l))]
if s < sum(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())
li = list(map(int,input().split()))
li.sort()
li.reverse()
sum = 0
for i in range(1,N) :
    sum+= li[i]
ans = "No"
if sum > li[0] :
    ans = "Yes"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
L = [int(x) for x in input().split()]
longest = max(L)
L.remove(longest)

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

Submission status: Accepted

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

Submission status: Accepted

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

ma=max(l)

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

Submission status: Accepted

Solution code:
num=int(input())
lineLength=[int(s) for s in input().split(" ")]
sortedLength=sorted(lineLength, reverse=True)
maxLength=int(sortedLength[0])
sumLength=0
for i in range(num-1):
  sumLength=sumLength+int(sortedLength[i+1])
if maxLength>=sumLength:
  print("No")
else:
  print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
L = [int(i) for i in input().split()]

MAX = max(L)
sum = sum(L) - MAX

if sum > MAX:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
a.sort()
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()))
l.sort(reverse=True)
flag=True
mx=l[0]
if mx < sum(l[1:n]):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
import numpy as np
N = int(input())
L = np.array([int(x) for x in input().rstrip().split()], np.int64)
L = np.sort(L)
if L[-1] < L[:N-1].sum():
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
table = [int(x) for x in input().split()]

table.sort()
sums = 0
for x in range(0, len(table) - 1):
    sums += table[x]
if max(table) < sums:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n=int(input())
x = sorted(list(map(int, input().split())))
if x[-1] < sum(x[0:n-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:
def read_input():
	n = int(input())
	ls = list(map(int, input().split()))
	
	return n, ls
	
	
def submit():
	n, ls = read_input()
	
	max_l = max(ls)
	rests = sum(ls) - max_l

	if max_l < rests:
		print('Yes')
	else:
		print('No')

if __name__ == '__main__':
	submit()

Submission status: Accepted

Solution code:
n = int(input())
lst = [int(i) for i in input().split()]
s = sum(lst)
for i in lst:
    if i * 2 >= s:
      print('No')
      quit()
print('Yes')

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()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき

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

Submission status: Accepted

Solution code:
#coding:utf-8
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:
n = int(input())
l = [int(i) for i in input().split()]
l.sort(reverse=True)
add = 0
for i in l[1:]:
    add += i
if add > l[0]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n=int(input())
L=[int(x) for x in input().split()]

max=max(L)
L.remove(max)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=int(input())
b=input().rstrip().split()
l=[]
for i in range(a):
  l.append(int(b[i]))
l.sort()
max = l[a-1]
SUM=sum(l[:a-1])

if (SUM > max):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N  = int(input())
L = [int(val) for val in 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(" ")))
Ls=sorted(L)

if Ls[-1]<sum(Ls[:-1]): # 作れる場合
    print("Yes")
else: # 作れない場合
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
L = [int(n) for n 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()))
l.sort(reverse=True)
if l[0] >= sum(l[1:]):
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
N = int(input())
edges = [ i for i in map(int, input().split())]
if max(edges) < sum(edges) - max(edges):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines


# rstrip().decode('utf-8')
# INF=float("inf")
#MOD=10**9+7
# sys.setrecursionlimit(2147483647)
# import math
#import numpy as np
# import operator
#import bisect
# from heapq import heapify,heappop,heappush
#from math import gcd
# from fractions import gcd
#from collections import deque
#from collections import defaultdict
# from collections import Counter
#from itertools import accumulate
# from itertools import groupby
# from itertools import permutations
# from itertools import combinations
# from scipy.sparse import csr_matrix
# from scipy.sparse.csgraph import floyd_warshall
# from scipy.sparse.csgraph import csgraph_from_dense
# from scipy.sparse.csgraph import dijkstra
# map(int,input().split())


def main():
	n,*l=map(int,read().split())
	lmax=max(l)
	lsum=sum(l)
	ans="No"
	if lmax<lsum-lmax:
		ans="Yes"
	print(ans)
	
	
	
	
	
if __name__ == "__main__":
		main()

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
N = int(input())

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

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

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,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 = [int(i) for i in input().split()]
longest = L[0]
for i in range(1, len(L)):
    if L[i] > longest:
        longest = L[i]
if 2 * longest < sum(L):
    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('No')
else:
    print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


a = int(input())
b = input()

b = (map(int,b.split()))
b = list(b)

L = b[0]

for i in range(1,a):
    if b[i] > L:
        L = b[i]

j = 0

for i in range(a):
    j += b[i]
    
j -= L

if j > L:
    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)-L[-1]:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

aaa =sum(L_list)-max(L_list)-max(L_list)

if aaa >0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
Larray = list(map(int,input().split()))
lmax = max(Larray)
Larray.remove(lmax)
ltot = 0
for i in Larray:
  ltot += i
if lmax < ltot:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n=int(input())
p=sorted(map(int,input().split()))[::-1]
print("Yes" if p[0]<sum(p[1:]) 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 "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_max = max(L)
L.remove(l_max)
if l_max < sum(L):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

L_list.sort()

if sum(L_list[:-1]) > L_list[-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

suml = 0
lmax = l[0]
for i in range(n):
  suml += l[i]
  if lmax < l[i]:
    lmax = l[i]

s = suml - lmax
if s > lmax:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
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()))
if 2 * max(l) < sum(l) :
    print("Yes")
else :
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import os, sys, re, math

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(a) for a in input().split()]
if max(l) < sum(l) - max(l):
	print('Yes')
else:
	print('No')

Submission status: Accepted

Solution code:
import os, sys, re, math

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

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

Submission status: Accepted

Solution code:
n = 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())
list1 = list(map(int,input().split()))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

L.sort(key=lambda x: -x)

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()))
s = max(l)
l.remove(s)
if s < sum(l):
	print ("Yes")
else:
	print ("No")

Submission status: Accepted

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int,input().split()))
L_copy = L.copy()
MAX = max(L)
L_copy.pop(L.index(MAX))


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

Submission status: Accepted

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

flag = 1
for i in range(N):
  ans = 0
  for j in range(N):
    if i!=j:
      ans += list[j]
    
  if ans <= list[i]:
      flag = 0
      break

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

Submission status: Accepted

Solution code:
input()
ls = list(map(int, input().split()))
lmax = max(ls)
lmaxi = ls.index(lmax)
lss = ls[:lmaxi] + ls[lmaxi+1:]
print("Yes" if lmax < sum(lss) else "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:
import numpy as np
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
b=np.array(a)
if b[0]<b[1:].sum():
  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()))
if max(l) * 2 < sum(l):
	print("Yes")
else:
	print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
x=max(a)
if x<(sum(a)-x):
  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())

ll = list(map(int,input().split()))
ll = sorted(ll)

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

Submission status: Accepted

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

m=max(l)
l.remove(m)
if(m<sum(l)):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# 2019-11-12 13:20:54(JST)
import sys
# import collections
# import math
# from string import ascii_lowercase, ascii_uppercase, digits
# from bisect import bisect_left as bi_l, bisect_right as bi_r
# import itertools
# from functools import reduce
# import operator as op
# from scipy.misc import comb # float
# import numpy as np 

def main():
    n, *l = (int(x) for x in sys.stdin.read().split())
    l.sort()
    if l[-1] < sum(l[:-1]):
        ans = 'Yes'
    else:
        ans = 'No'
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(raw_input())
s = map(int, raw_input().split())

x = sorted(s)

a = x[-1] < sum(x[:-1])

print "Yes" if a else "No"

Submission status: Accepted

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

longline = L.pop(L.index(max(L)))
not_longline_total = sum(L)

if longline < not_longline_total:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
input()
l = [int(i) for i in input().split()]
l.sort()
print("Yes" if l[-1] < sum(l[:-1]) else "No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
L = list(map(int, input().split()))

L.sort()
sum = 0
for i in range(N-1):
  sum += L[i]

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

Submission status: Accepted

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

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

main()

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

Submission status: Accepted

Solution code:
N = input()
li = list(map(int,input().split()))
print('Yes' if max(li)*2<sum(li) 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]"):
    if 2*max(L) < sum(L):
        print(YES)
    else:
        print(NO)
    return


# 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]"
    solve(N, L)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

s_L = list(sorted(s_L,reverse=True))
if s_L[0] < sum(s_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)
L.remove(max_L)

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

Submission status: Accepted

Solution code:
def solve():
    N, *l = map(int, open(0).read().split())

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


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int, input().split()))
l = sorted(l)
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.sort(reverse=True)

if l[0] < sum(l[1:]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
l = [int(x) for x in input().split()]
l.sort()
if sum(l[0:n-1])>l[-1]:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
from sys import stdin
import bisect

n = int(stdin.readline().rstrip())
li = list(map(int,stdin.readline().rstrip().split()))

li.sort()

if sum(li[:n-1]) > li[-1]:
    print("Yes")
    exit()

print("No")

Submission status: Accepted

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

Submission status: Accepted

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

llmax = max(ll)
l_all = 0
for i in ll:
  l_all += i
l_all -= llmax
if llmax < l_all:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

if 2*max(L) < sum(L):
    print('Yes')
else :
    print('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=input().split()
ans='Yes'
for i in range(n):
    l[i]=int(l[i])
for j in range(n):
    if l[j]>=sum(l)-l[j]:
        ans='No'
        break
    else:
        continue
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

l.sort()
if l[n-1] < sum(l[:n-1]):
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int,input().split()))
sum = 0
maximum = max(L)
L.remove(max(L))
for i in range(len(L)):
  sum += L[i]
if sum>maximum:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

max_l = max(l_list)
l_list.pop(l_list.index(max_l))
sum_l_but_max = sum(l_list)

if max_l < sum_l_but_max:
    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 = sorted([int(i) for i in input().split()])

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

Submission status: Accepted

Solution code:
N = int(input())
l = sorted(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 = sorted([int(x) for x in input().split()])
cnt = 0
for l in L[:-1]:
    cnt += l
print('Yes' if (L[-1] < cnt) else '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 = sorted(map(int,input().split()))
print("Yes" if sum(l[:-1]) > l[-1] else "No")

Submission status: Accepted

Solution code:
a = [input().split() for l in range(2)]
N = int(a[0][0])
L = list(map(int, a[1]))
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()
m=0
for i in range(N-1):
  m+=L[i]
if m>L[N-1]:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

l.sort()

for i in range(n - 1):
    x += l[i]

y = l[n - 1]

if x > y:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

max_L = 0
sum_L = 0
for i in range(N):
    sum_L += L[i]
    if L[i] > max_L:
        max_L = L[i]
    
sum_L -= max_L
if max_L < sum_L:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
L = [int(i) for i in input().split()]
print("{}".format("Yes" if max(L) < sum(L[:L.index(max(L))] + L[L.index(max(L)) + 1:]) else "No"))

Submission status: Accepted

Solution code:
from sys import stdin
import numpy as np

N = int(stdin.readline().strip())
L = np.array(list(map(int,stdin.readline().strip().split())))

if L.sum()-np.max(L) > np.max(L):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

truth = True
for i in range(len(lengths)):
	curr = lengths[:i]+lengths[i+1:]
	if sum(curr) <= lengths[i]:
		truth = False
		break
	
print(["No","Yes"][truth])