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:
def run(N, L):
    L = sorted(L)
    ret = 'No'
    if 2*L[-1] < sum(L):
        ret = 'Yes'
    return ret


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:

# coding: utf-8

# In[34]:


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


# In[35]:


sorted_l = sorted(L, reverse=True)

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

Submission status: Accepted

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

Submission status: Accepted

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

m = max(alist)
alist.remove(m)
if m < sum(alist):
  print("Yes")
else:
  print("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:
N = int(input())
l = list(map(int,input().split()))
a = max(l)
l.remove(a)
print('Yes' if sum(l)>a else 'No')

Submission status: Accepted

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

list = sorted(list_original)
longest = list[N-1]
other_sum = 0

for i in range(N-1):
    other_sum += list[i]

if longest < other_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())
L = [int(x) for x in input().split()]
L.sort()

a = L.pop()
b = sum(L)

if b > a:
    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=[int(i) for i in input().split(" ")]
L.sort(reverse=True)
if L[0]<sum(L[1:]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def get_int(): return int(input())
def get_float(): return float(input())
def get_line(): return input().split()
def get_lines(v): return [get_line() for _ in range(v)]
def get_int_line(): return list(map(int, get_line()))
def get_int_lines(v): return [get_int_line() for _ in range(v)]
def get_float_line(): return list(map(float, get_line()))
def get_float_lines(v): return [get_float_line() for _ in range(v)]

N = get_int()
L = get_int_line()
L.sort()
sum = 0
for i in range(N - 1):
  sum += L[i]
if (sum > L[N - 1]):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(raw_input())
l = map(int, raw_input().strip().split(' '))

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

Submission status: Accepted

Solution code:
N=int(input())
L=input().split()
L=[int(i) for i in L]
L.sort(reverse=True)
sum=0
for i in range(1,N):
	sum+=L[i]
if L[0] < sum:
	print('Yes')
else:
	print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from functools import reduce
from operator import add

n = int(input())

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

sl = sorted(l, reverse=True)

sum_length = reduce(add, sl[1:])

if sl[0] < sum_length:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
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())
a = list(map(int, input().split()))
max = a[0]
s = sum(a)
for i in range(1,n):
    if a[i] > max:
        max = a[i]
if (s - max) > max:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
L = [int(i) for i in input().split()]
L.sort()
max_edge = L[-1]
total_length = 0
for i in L[:-1]:
    total_length += i

if max_edge < total_length:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
L.sort()
L.reverse()
Lmax = L.pop(0)
if Lmax < sum(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())
l = list(map(int, input().split()))

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

Submission status: Accepted

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

max_length = max(length)

length.remove(max_length)

sum_other_length = sum(length)

if sum_other_length > max_length:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#1150から
import numpy as np
N = int(input())
li = list(map(int, input().split()))
li.sort(reverse=True)
#numpyのndarrayに変換
arr = np.array(li)
if np.sum(arr) - arr[0] > arr[0]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# coding: utf-8
n = int(input())
data = list(map(int, input().split()))
longest = max(data)
if longest < sum(data) - longest:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

longest = L.pop(L.index(max(L)))
if longest < 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 max<sum(l)-max:
 print("Yes")
else:
 print("No")

Submission status: Accepted

Solution code:
import sys
N = int(input())
A = [int(n) for n in input().split()]
maxA = max(A)
if(sum(A) - 2*maxA >0):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(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()]
a = max(l)
b = sum(l) - max(l)
print("Yes" if a < b else "No")

Submission status: Accepted

Solution code:
a  = int(input())
A = []
B = list(input().split())
for i in B:
    n = int(i)
    A.append(n)
ma = max(A)

su = sum(A)
if(ma < su - ma):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

l = max(lines)
lines.remove(l)

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

Submission status: Accepted

Solution code:
from sys import stdin


class Main:

    @staticmethod
    def main():
        n = stdin.readline()
        ls = [int(x) for x in stdin.readline().strip().split()]
        ls.sort(reverse=True)
        if ls[0] < sum(ls[1:]):
            print('Yes')
        else:
            print('No')


if __name__ == '__main__':
    Main.main()

Submission status: Accepted

Solution code:
n = int(input())
list = list(map(int, input().split()))
l_max = max(list)
l_sum = sum(list)

if l_max < (l_sum - l_max):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
a=input()
c=list(map(int, input().split()))
 
#from statistics import mean, median,variance,stdev
 
if sum(c)-max(c) > max(c):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
i=input;i();l=list(map(int,i().split()));print(["No","Yes"][max(l)*2<sum(l)])

Submission status: Accepted

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

n = 2
e = [[int(i) for i in input().split()] for i in range(n)]

e[1].sort(reverse=True)

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

Submission status: Accepted

Solution code:
a = int(input())

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

Submission status: Accepted

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

if __name__ == "__main__":
	main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s1=input()
s2=input().split()
n2=[int(i) for i in s2]
a=sorted(n2,reverse=True)

max=a[0]
cnt=a[1:]
all=sum(cnt)

if(max<all):
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# the number of inputs
N = int(input())
# each length of edges
Ls= list(map(int, input().split()))

# searching largest one
largestL = 0
largestIndex = 0

# straightforward way
for i in range(N):
  if Ls[i] > largestL:
    largestL = Ls[i]
    largestIndex = i

sumOfSmallLs = 0
for i in range(N):
  if i != largestIndex:
    sumOfSmallLs += Ls[i]

if sumOfSmallLs > largestL:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

flg = 0
for l in L:
  if not sum(L)-l > l:
    print('No')
    flg = 1

if not flg: print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

L = sorted(L)

for x in L[:N-1]:
    sum += x

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

Submission status: Accepted

Solution code:
# coding:utf-8


n = int(input())
L = list(map(int, input().split()))
sorted_ = sorted(L)
max_ = sorted_[-1]
sum_ = sum(sorted_[:-1])
if max_ < sum_:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import numpy as np

n = int(input())
len_box = []
for _ in input().split():
    len_box.append(int(_))
len_box = np.array(len_box)
len_max = np.max(len_box)
len_sum = np.sum(len_box)
if (len_sum-len_max) > len_max:
    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:
N = int(input())
L = tuple(int(x) for x in input().split())

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

Submission status: Accepted

Solution code:
# B
N = int(input())
L = list(map(int, input().split()))
m = max(L)
s = sum(L)
if m < s - m:
    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を入力する
n = int(input())

#Lを入力する
l = list(map(int,input().split()))


#max<他の合計の場合YES,
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()))
m = max(l)
l.remove(m)
if m < sum(l):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
lists=[-int(a) for a in input().split(" ")]
lists.sort()
max=lists[0]
sum=0
for a in range(1,N):
    sum+=lists[a]
if(max>sum):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

L_chk = sum(L) - max(L)

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
B - Polygon

"""
import sys
from sys import stdin
input = stdin.readline


def solve(L):
    return 'Yes' if L[-1] < sum(L[:-1]) else 'No'


def main(args):
    N = int(input())
    L = sorted([int(l) for l in input().split()])
    print(solve(L))


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
import numpy as np
i = input()
l = [int(j) for j in input().split()]
ls = np.sort(l)
s = np.sum(ls) - ls[-1]
print("Yes" if s > ls[-1] else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def can_be_drawn(L):
        sum_len = 0
        max_len = 0
        for l in L:
                sum_len += l
                max_len = max(max_len, l)
        return 'Yes' if max_len < (sum_len - max_len) else 'No'


input()
L = [int(v) for v in input().split()]
print(can_be_drawn(L))

Submission status: Accepted

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

Submission status: Accepted

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

Lmax = max(L)
Lsum = sum(L) - Lmax

if Lmax < Lsum: print( 'Yes' )
else: print( 'No' )

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
n = int(input())
data = np.array([int(i) for i in input().split()])
data = np.sort(data)[::-1]
if data[0]<data[1:].sum():
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
l=[int(i) for i in input().split()]
l.sort()
sum=0
for i in range(N-1):
    sum+=l[i]
if sum>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)*2<sum(L) else "No")

Submission status: Accepted

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

SUM=0
for i in range(0,N-1):
       SUM+=L[i]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

sides = [int(i) for i in input().split()]
lMax = max(sides)
lSum = sum(sides) -lMax
if lSum > lMax:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

max_num = max(l)
max_index = l.index(max(l))
l.pop(max_index)

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

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    l = list(map(int,input().split()))
    s = 0
    lmax = max(l)

    l.remove(lmax)

    for i in l:
        s += i
    if lmax < s :
        print("Yes")
    elif lmax >= s :
        print("No")

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

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

l_max = np.max(l)
l_other_sum = sum(l) - l_max

if l_max < l_other_sum:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

s = sum(l) - 2*max(l)

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

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

Submission status: Accepted

Solution code:
N = 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 = 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())
Lin = input().split(" ")

Lls = []

for i in range(0,N):
    Lls.append(int(Lin[i]))

Lls.sort(reverse = True)

maxSide = Lls[0]
otherSide = 0
for i in range(1,N):
    otherSide = otherSide + Lls[i]

if maxSide < otherSide:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
number_list = []
for i in map(int, input().split()):
    number_list += [i]

for i in range(N-1):
    for j in range(N):
        if i < j:
            if number_list[i] > number_list[j]:
                a = number_list[i]
                number_list[i] = number_list[j]
                number_list[j] = a

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

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

Submission status: Accepted

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

max_length = max(L)

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

Submission status: Accepted

Solution code:
n = int(input())

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

long = l[0]
sum = 0

for i in range(1, len(l)):
    sum += l[i]

if long < sum:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
input()
ary = [int(s) for s in input().split()]

max_Hen = max(ary)
ary.remove(max(ary))
sum_Hen = sum(ary)

if(max_Hen < sum_Hen):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

l.sort()

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

Submission status: Accepted

Solution code:
num = input()

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

line.sort(reverse=True)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
L = input().split()
L = [int(s) for s in L]
i = 0
L_max = L[0]
for i in range(len(L)):
    if L_max < L[i]:
        L_max = L[i]
if L_max < sum(L) - L_max:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
L = input().split()
max = 0
total = 0
for i in range(N):
    if max < int(L[i]):
        max = int(L[i])
    else:
        pass
for i in range(N):
    total += int(L[i])
total = total - max

if max < total:
    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(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_array = list(map(int, input().split()))
L_max = max(L_array)
L_sum = sum(L_array)
print('Yes' if L_max < L_sum - L_max else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input()
l = [int(x) for x in input().split()]
print(["No","Yes"][2*max(l) < sum(l)])

Submission status: Accepted

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

max_len = max(l_list)
other_total = sum(l_list) - max_len

if max_len < other_total:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

l_sum = sum(l)
l_max = max(l)

if (l_sum - l_max > l_max):
    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(input())
L_list = list(map(int, input().split()))
L_max = max(L_list)
L_sum = sum(L_list) - L_max
if L_max < L_sum:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

x = list(map(int,input().split()))
a = max(x)
sum = 0

for i in range(len(x)):
    sum += x[i]
if sum - a > a:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

s = sum(l)
res = "Yes"
for x in l:
  if (2*x>=s):
    res = "No"
print(res)

Submission status: Accepted

Solution code:
num = input()
lines = [int(x) for x in input().split()]
mx = max(lines)
ss = sum(lines) - mx

print(('Yes' if mx < ss else 'No'))

Submission status: Accepted

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

l_sum = 0
for i in range(len(l)):
    if i != l.index(max(l)):
        l_sum += l[i]

if max(l) < l_sum:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
num = int(input())
l = list(map(int, input().split()))
max = l.pop(l.index(max(l)))
sum = 0
for i in range(len(l)):
    sum = sum + l[i]
if sum <= max:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

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[n-1]):
  print('No')
else:
  print('Yes')

Submission status: Accepted

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

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

L_max = max(L)
L_sum = sum(L)

if L_max < L_sum-L_max :
  print ('Yes')
else :
  print('No')

Submission status: Accepted

Solution code:
# B - Polygon


def main():
    s1 = input()
    s2 = input()
    ret = solve(s1, s2)
    print(ret)


def solve(s1, s2):
    N = int(s1)
    L = [int(x) for x in s2.split()]
    if(max(L) < sum(L) - max(L)):
        return "Yes"
    else:
        return "No"


main()

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[1:]) else 'No')

Submission status: Accepted

Solution code:
def prob_b():
    N = int(input())
    P = list(map(int, input().split(' ')))

    longest = 0
    total_len = 0

    for p in P:
        longest = max(longest, p)
        total_len += p

    if (longest + longest) < total_len:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    prob_b()

Submission status: Accepted

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

# print(N)
# print(ll)
print('Yes' if sum(ll) - 2 * max(ll) >0 else 'No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
L = [int(x) for x in input().split(' ')]
nmax = 0
nsum = 0
for k in L:
    if nmax < k:
        nmax = k
    nsum += k

nsum -= nmax
if nsum > nmax:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
from sys import stdin

def main():
    N = stdin.readline().rstrip()
    L_list = [int(L) for L in stdin.readline().rstrip().split()]
    L_list.sort()
    if L_list[-1] < sum(L_list[:-1]):
        print('Yes')
    else:
        print('No')

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(200000)


def input():
    return sys.stdin.readline()[:-1]


def ii(t: type = int):
    return t(input())


def il(t: type = int):
    return list(map(t, input().split()))


def imi(N: int, t: type = int):
    return [ii(t) for _ in range(N)]


def iml(N: int, t: type = int):
    return [il(t) for _ in range(N)]


def solve():
    N = ii()
    L = sorted(il())
    return "Yes" if L[-1] < sum(L[:-1]) else "No"


if __name__ == "__main__":
    print(solve())

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# Nの取得
index = int(input())

# n回ループして配列に入れる
maximum = 0
other = 0
inputList = input().split()
for i in range(index):
    tmp = int(inputList[i])
    if tmp > maximum:
        maximum = tmp
        other = other + maximum
    else:
        other = other + tmp

if maximum < other - maximum:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
Ls=[i for i in map(float,input().strip().split())]
if N==len(Ls):
    mx=max(Ls)
    sm=sum(Ls)-mx
    if mx<sm:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


# aとbの最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


# aとbの最小公倍数
def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

print('Yes' if sum(l) - max(l) * 2 > 0 else 'No')