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:
input()
l, *L = sorted(map(int, input().split()), reverse=True)
print("Yes" if sum(L) > l else "No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

l_max = max(L)
sum_others = sum(L) - l_max

if l_max < sum_others:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
l_max=max(l)
if l_max<sum(l)-l_max:
    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=list(map(int,input().split()))
L=sorted(L)
total=0
for i in range(N-1):
    total+=L[i]
print('Yes' if total>L[N-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 = list(map(int, input().split()))
if max(L) < (1/2)*sum(L):
    print('Yes')
else:
    print('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())
L = list(map(int, input().split()))

L.sort()

L_max=L[-1]
L_sum=sum(L[:-1])

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
l.sort()
t=l[-1]
s=sum(l[:-1])
if s > t:
  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 = [int(x) for x in input().split()]

biggest = max(l)
l.remove(biggest)

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

Submission status: Accepted

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

S = sum(l)

M = max(l)

if S - M > M:
    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
print("Yes" if Lmax < Lsum else "No")

Submission status: Accepted

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

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:
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 main(n: int, l: list):
    l.sort()

    m = l.pop()

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


if __name__ == "__main__":
    n = int(input())
    l = list(map(int, input().split()))

    main(n, l)

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 = int(input())

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

L_max = max(L_list)
L_sum_without_max = sum(L_list) - L_max

if L_max < L_sum_without_max : print("Yes")
else: print("No")

Submission status: Accepted

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

def main():
    _ = int(input())
    L = tuple(map(int, input().split()))

    sum_l = sum(L)
    for l in L:
        if 2 * l >= sum_l:
            print('No')
            break
    else:
        print('Yes')
    
if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

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

print('Yes') if L_max < sum(L) else print('No')

Submission status: Accepted

Solution code:
import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda x: [na() for _ in range(x)]
ns = lambda: stdin.readline().rstrip()
nas = lambda: stdin.readline().split()

n = ni()
l = na()
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()))

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

if m < s:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
L.sort()
max = L.pop()
if max < sum(L):
  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
if s > m:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

lmax = max(L)
L.remove(lmax)
tot = sum(L)

if lmax < tot:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

l.sort()

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

Submission status: Accepted

Solution code:
# 117 b
n=int(input())
l=list(map(int,input().split()))
ans=False
max_l=max(l)
nokori=sum(l)-max_l
if max_l<nokori:
    ans=True
print("Yes" if ans 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)-l[0]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

sum_l = sum(l)-l[len(l)-1]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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 = map(int, input().split())
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()))
max_l=L.pop(L.index(max(L)))
print('Yes' if max_l<sum(L) else 'No')

Submission status: Accepted

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

lmax = max(L)
L.remove(lmax)
l = sum(L)
if lmax < 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)
if L[0]<sum(L[1:]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

max_width = max(L)
residue_width_sum = sum(L)-max_width

judge = 'Yes' if max_width < residue_width_sum else 'No'

print(judge)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
num = list(map(int,input().split()))
err=0
for i in range(N):
  if 2*num[i]>=sum(num):
    err+=1
if err>0:
  print("No")
else:
  print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

l = sorted(l, 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()))
sum=0
for i in range(N):
    sum=sum+L[i]
L.sort(reverse=True)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
li=list(map(int,input().split()))
w=max(li)
li.remove(max(li))
if w<sum(li):
    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:
import sys

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
LIST = lambda: list(map(int, INPUT().split()))

sys.setrecursionlimit(10 ** 9)


def main():
    N = INT()
    L = LIST()

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

max_index = l.index(max(l))

sum_length = 0

for x in range(n):
	if x == max_index:
		continue
	sum_length += l[x]

print ("Yes") if sum_length > max(l) else print ("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
import itertools

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

l.sort(reverse=True)
max=l.pop(0)
for i in range(len(l)-1):
	l[i+1]=l[i]+l[i+1]

if max<l[-1]:
	print("Yes")
else :
	print("No")

Submission status: Accepted

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

s = sum(l)
m = max(l)
if s - m > m:
  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 = sorted(list(map(int, input().split())))
print('YNeos'[sum(l[:n-1])<=l[n-1]::2])

Submission status: Accepted

Solution code:
n = int(input())
l = sorted(map(int, input().split()))
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()))
#print(l)
z = max(l)
#print(z)
if sum(l) - max(l) > max(l):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
L = [int(a) for a in input().split()]
maxL = max(L)
excep = sum(L)-maxL
if maxL<excep:
    print('Yes')

else:
    print('No')

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:
n = int(input())
numlist = list(map(int,input().split()))
del numlist[n::]

numlist.sort()
maxl = numlist.pop(-1)

if maxl < sum(numlist):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

x = 0
maxside = 0
for i in range(n):
    if maxside < l[i]:
        maxside = l[i]
        x = i
del l[x]
sum = 0
for i in range(n - 1):
    sum += l[i]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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_ls = list(map(int,input().split()))
l_ls.sort()
s_len = 0

for i in range(n-1):
    s_len += l_ls[i]

if s_len > l_ls[-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

M = max(point)

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

Submission status: Accepted

Solution code:
n=int(input())
line=list(map(int,input().split()))
border=sum(line)/2
 
flag=True
for i in line:
  if i >= border:
    flag=False
    break
 
if flag:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    L = list(map(int, input().split(" ")))
    L.sort()
    sum_except_max = sum(L[:-1])
    if sum_except_max > 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()))

L.sort(reverse=True)
sum_l = 0
for i in range(1, len(L)):
    sum_l += L[i]

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

Submission status: Accepted

Solution code:
n=int(input())

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

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

Submission status: Accepted

Solution code:
n = int(input())

eList = sorted(list(map(int,input().split())),reverse = True)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
longest = max(L)
rest = sum(L) - longest

if longest < rest:
    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())
lengths = [int(i) for i in input().split()]

# 最長の辺を取り出す
longest_index = lengths.index(max(lengths))
longest = lengths.pop(longest_index)

# 最長の辺と、残りの辺の合計を比較
if longest < sum(lengths):
    print('Yes')
else :
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
Llist = list(map(int, input().split()))
Lmax = max(Llist)
elseL = sum(i for i in Llist) - Lmax
if elseL <= Lmax:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 16, Jan, 2020
"""

import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N = int(readline())
L = list(map(int, readline().split()))
Lm=max(L)
S = sum(L)
ans = True

print('Yes' if S>2*Lm else 'No')

Submission status: Accepted

Solution code:
n, *D,  = [list(map(int, s.split())) for s in open(0)]
n, D = n[0], D[0]

D = sorted(D, reverse=True)
m = D[0]
length = 0
for i in range(1, len(D)):
    length += D[i]
if length > m:
    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 = int(input())
l = list(map(int,input().split()))
if 2*max(l)>= sum(l):
  print("No")
else:
  print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

Solution code:
N = int(input())
L = input().rstrip().split()

for i in range(len(L)):
  L[i] = int(L[i])
L.sort()
maxl = L[len(L)-1]
leftl = sum(L[0:len(L)-1])

if maxl < leftl:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import sys

n, *l = map(int, sys.stdin.read().split())

def main():
    circumstance = sum(l)
    l_max = max(l)
    return 'No' if circumstance - l_max <= l_max else 'Yes'
    
if __name__ == '__main__':
    ans = main()
    print(ans)

Submission status: Accepted

Solution code:
n = int(input())
L = list(map(int,input().split()))
maxL = max(L)
sum = 0
flag = True
for l in L:
  if l == maxL and flag:
    flag = False
  else:
    sum += l
if maxL < sum:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**9)
INF=10**18
def input():
    return sys.stdin.readline().rstrip()

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

max_len = max(Ls)
Ls.remove(max_len)
if max_len < sum(Ls):
    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 = input()
N = int(N)
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')

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()))
L = sorted(L)
longest = L[-1]
L = L[:N-1]

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
input_angle = int(input())
input_length = input()

_length = input_length.split(' ')
length = [int(l) for l in _length]
length.sort()
sum = 0

for i in range(input_angle-1):
  sum += int(length[i])
  
if int(length[-1]) < 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=list(map(int,input().split()))
sl=sorted(l)
if sl[-1]<sum(sl[:-1]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
L_s = str(input()).split(" ")
L = []
for l in L_s:
    L.append(int(l))

max_v = int(max(L))
L.pop(L.index(max(L)))

sum = 0
for i in L:
    sum += int(i)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

henCount = int(input().rstrip())

henList = sorted([int(i) for i in input().rstrip().split(" ")])
henList.reverse()
long = henList[0]
subTotal = sum(henList) - long

ans = "Yes"

if long >= subTotal:
    ans = "No"
print(ans)

Submission status: Accepted

Solution code:
A = int(input())
B = list(map(int,input().split(" ")))
B.sort(reverse=True)
Max_B = B[0]
B.pop(0)
if sum(B) > Max_B:
	print("Yes")
else:
	print("No")

Submission status: Accepted

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

L_i = [int(s) for s in L]

Length = 0
sum = 0
num = 0

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

    if L_i[i] > Length:
        Length = L_i[i]
        num = i


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
max_num = sorted(L)[-1]
sum_hen = sum(sorted(L)[:-1])
print('Yes' if max_num < sum_hen else '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 = input()
l = list(map(int,input().split()))
maxi = max(l)

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

Submission status: Accepted

Solution code:

n = int(input())

L = list(map(int, input().split()))
l = 0
s = sum(L)

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

Submission status: Accepted

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

cur_longest = 0
sum_others = 0

for l in ls:
    sum_others += l
    if l > cur_longest:
        sum_others -= l
        sum_others += cur_longest
        cur_longest = l

if cur_longest >= sum_others:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

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

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

N = int(sys.stdin.buffer.readline())
L = list(map(int, sys.stdin.buffer.readline().split()))


L = np.array(L, dtype=int)
ok =  L.max() < L.sum() - L.max()
if ok:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def p_b():
    n = int(input())
    *L, = map(int, input().split())
    print("Yes" if max(L) < sum(L) - max(L) else "No")
    
p_b()

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

max_b = max(B)
if sum(B) - max_b > max_b:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
li_L = list(map(int, input().split()))
a = max(li_L)
li_L.remove(a)
if a < sum(li_L):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
S = str(input())
S = S.split()
S_list = list(S)
for i in range(len(S_list)):
    S_list[i] = int(S_list[i])

S_list.sort()
S_list.reverse()
total = 0

for i in range(len(S_list)):
    if i > 0:
        total = total + S_list[i]

if S_list[0] < total:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

l = sorted(l)

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

l.sort()

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

Submission status: Accepted

Solution code:
M = input()
N = list(map(int,input().split()))
N = sorted(N,reverse=True)
sum = sum(N[1:])
if(N[0]<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)*2:
    ans = "Yes"
else:
    ans = "No"

print(ans)

Submission status: Accepted

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

Lmax = max(L)
L.remove(Lmax)
LN = sum(L)

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

Submission status: Accepted

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

Submission status: Accepted

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

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