Problem:


Score : 200 points

Problem Statement

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

You can use the following theorem:

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

Constraints

All values in input are integers.

3 \leq N \leq 10

1 \leq L_i \leq 100

Input

Input is given from Standard Input in the following format:

N
L_1 L_2 ... L_N

Output

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

Sample Input 1

4
3 8 5 1

Sample Output 1

Yes

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

Sample Input 2

4
3 8 4 1

Sample Output 2

No

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

Sample Input 3

10
1 8 10 5 8 12 34 100 11 3

Sample Output 3

No



Sample input:
4
3 8 5 1


Sample output:
Yes

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
B - Polygon
https://atcoder.jp/contests/abc117/tasks/abc117_b

"""
import sys


def solve(L):
    rest, longest = L[:-1], L[-1]
    return ['No', 'Yes'][sum(rest) > longest]


def main(args):
    _ = int(input())
    L = map(int, input().split())
    ans = solve(sorted(L))
    print(ans)


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())

N = int(input())
LL = inpl()
if max(LL)*2 >= sum(LL):
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    N = int(input())

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

    max_L = max(L_list)

    sum_L = 0
    for L in L_list:
        sum_L += L

    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()))
a.sort()
if sum(a)-2*a[n-1]>0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

ma = max(L)
s = sum(L) - ma

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    _ = int(stdin.readline().rstrip())
    Ls = [int(x) for x in stdin.readline().rstrip().split()]
    max_ = max(Ls)
    Ls.remove(max_)
    print('Yes' if max_ < sum(Ls) else 'No')


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#ABC 117 B
n = int(input())
length = list(map(int, input().split()))
max_len = max(length)
length.remove(max_len)
if max_len < sum(length):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

a = sorted(a)

if sum(a[0:-1]) <= a[-1]:
  print("No")
else:
  print("Yes")

Submission status: Accepted

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

l.sort()
l.reverse()
maxl = l.pop(0)
suml = 0
for i in range(len(l)):
  suml += l[i]

if maxl < suml:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

L.sort(reverse=True)
max_edge_length = L[0]
no_max_edge_sum_length = sum(L[1:])

if max_edge_length < no_max_edge_sum_length:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
print("YNeos"[sum(l)<=max(l)*2::2])

Submission status: Accepted

Solution code:
n = int(input())
l = [int(i) for i in input().split()]
l_max = max(l)
del l[l.index(l_max)]
if sum(l) > l_max:
  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:
#coding:utf-8

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

    Llist = list(L)
    Llist.sort(reverse=True)
    numlist = []
#   print(Llist)

    for i in range(1,N):
        numlist.append(Llist[i])

    if Llist[0] < sum(numlist):
        print('Yes')
    else:
        print('No')

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

m = (max(l))

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

Submission status: Accepted

Solution code:
N = int(input())
L = sorted([int(i) for i in 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()))
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 = sorted([int(i) for i in input().split()])

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

Submission status: Accepted

Solution code:
import numpy as np
n = int(input())
L = [int(j) for j in input().split()]
if 2 * max(L) < np.sum(L):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
length = list(map(int, input().split()))
maxl = max(length)
index = length.index(maxl)
length.pop(index)

if maxl < sum(length):
    print('Yes')
else:
    print('No')

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

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

Submission status: Accepted

Solution code:
N = int(input())
L = [int(a) for a in 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 = sorted(L)
su = 0
for i in range(N-1):
    su += l[i]
    
if l[-1] < su:
    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())
l = list(map(int, input().split()))

max_l = max(l)
sum_l = sum(l)

if max_l < sum_l - max_l:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n,*l=map(int,open(0).read().split());print('YNeos'[max(l)>=sum(sorted(l)[:-1])::2])

Submission status: Accepted

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

M = max(l)
S = sum(l)

if M*2<S :
    s = 'Yes'
else:
    s = 'No'
    
print(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
a = int(input())
A = []
for i in range(1):
    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())
list1=list(map(int, input().split()))
t= 2*max(list1)- sum(list1)
if t < 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N = int(input())

maxL = 0
total = 0
for i in input().split():
    tmp = int(i)
    if maxL < tmp:
        maxL = tmp
    
    total = total + tmp

total = total - maxL
if maxL < total:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())

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

L.sort()
long = L[-1]

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

if ans > long:
    print ('Yes')
else:
    print ('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = int(input())

B = input().split()
C = 0
for i in B:
    if C <= int(i):
        C = int(i)

B.remove(str(C))
D = 0
for i in B:
    D += int(i)

if D > C:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
from functools import reduce
from operator import add
N = int(input())
A = list(map(int, input().split()))
A_max = max(A)
A.remove(A_max)
#print(A)
#print(A_max)
#print(reduce(add ,A))
if A_max < reduce(add ,A):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

li = sorted(li)
max_len = li[-1]
sum_len = sum(li[:-1])

if max_len >= sum_len:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

def solve():
    N = int(input())
    L = list(map(int, input().split()))
    L.sort()
    
    longest = L[-1]
    sum = 0
    for i in range(len(L)-1):
        sum += L[i]
    
    if longest < sum:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    solve()

Submission status: Accepted

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

mx = max(L)
els = sum(L) - mx

if mx < els:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

s=max(i)
d=sum(i)-s

if d > s:
 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 sum(L[0:N-1])>L[N-1] else print("No")

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    N = int(input())
    L_list = list(map(int, (input().split(' '))))
    L_list.sort(reverse=True)
    L_max = L_list.pop(0)
    L_sum = sum(L_list)
    if L_sum > L_max:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

max_len = max(L)
sum = 0
for i in L:
    sum += i
sum -= max_len

print("Yes" if sum > max_len else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
L = [int(x) for x 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,*l,=map(int,open(0).read().split())
l=sorted(l,reverse=True)
print('Yes' if max(l)<sum(l[1:]) else 'No')

Submission status: Accepted

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

l.sort()

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in l:
    if max <= i:
        max = i

for i in l:
    sm += i

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
from math import *
from itertools import *
from collections import *
from functools import *
try:
    from math import gcd
except Exception:
    from fractions import gcd

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

def solve(N: int, L: "List[int]"):
    ll = sorted(L)
    return YES if ll[-1] < sum(ll[:-1]) else NO


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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=input()
b=[int(i) for i in input().split()]
print(["No","Yes"][sum(b)>2*max(b)])

Submission status: Accepted

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

Submission status: Accepted

Solution code:

n = 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())
lstl = list(map(int,input().split()))
x = max(lstl)
lstl.remove(max(lstl))
if x<sum(lstl):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n = input()
l = map(int,input().split())
ld = sorted(l, reverse=True)
m = ld[0]
h = sum(ld[1:])
if m < h:
  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()))
m = max(L)
print(["No", "Yes"][sum(L) - m > m])

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

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

l_max = max(l_arr)

for i in range(len(l_arr)):
    if l_arr[i] == l_max:
        break

l_arr.pop(i)

if sum(l_arr) > l_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("No")
else :
  print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

L.sort()
L.reverse()

x=0
for j in range(N):
    x=x+L[j]

y=x-L[0]

if L[0]<y:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
L.sort(reverse=True)
print("Yes" if (L[0] < sum(L[1:])) else "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_sum = sum(L)
Ln_sum = sum(L) - L_max
if L_max < Ln_sum :
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
l=list(map(int, input().split()))  #リスト入力

maxl = max(l)
suml = sum(l) - maxl

if maxl < suml:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
Length = list(map(int, input().split()))
if sum(Length) > 2*max(Length):
  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:
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 = int(input())
llist = [int(l) for l in input().split()]

maxl = 0
for l in llist:
    maxl = max(l, maxl)

suml = 0
maxl_checker = maxl
for l in llist:
    if l == maxl_checker:
        maxl_checker = -1
        continue
    suml += l

print('Yes' if maxl < suml 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()))

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

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

if Max < X:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
count = 0
idx = L.index(max(L))
for i in range(N):
    if i != idx:
        count += L[i]
if count > max(L):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
N = int(input())
Ls = sorted(list(map(int,input().split())))
print("Yes" if max(Ls) < sum(Ls) - max(Ls) else "No")

Submission status: Accepted

Solution code:
# coding: utf-8
N = int(input())
Ls = sorted(list(map(int,input().split())))
print( "Yes" if Ls.pop() < sum(Ls) else "No")

Submission status: Accepted

Solution code:
N = int(input())

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

L.sort(reverse = True)

sum = 0
for i in L[1:]:
    sum += i
if sum > L[0]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
max_L = max(L)
for i in range(N):
    if max_L == L[i]:
        del L[i]
        break
if max_L < sum(L):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

a = L.pop(L.index(max(L)))

sum = 0

for i in L : 
    sum += i
    
if a < sum : print("Yes")
else : print("No")

Submission status: Accepted

Solution code:
# ABC117B - Polygon
n = int(input())
lst = sorted(list(map(int, input().rstrip().split())))
print("Yes" if sum(lst) > lst[-1] * 2 else "No")

Submission status: Accepted

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

sum = 0
for i in range(n):
    sum += l[i]

if max(l) < sum - 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())
Ln = list(map(int, input().split()))

M = max(Ln)

if M < sum(Ln)-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())
li = list(map(int, input().split()))
long = max(li)
li.remove(long)
s = 0
for i in li:
  s += i
if s > long:
  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:
#117 B
N =int(input())
L =[int(j) for j in input().split()]
if max(L) < sum(L)-max(L):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n=int(input())
li=list(map(int,input().split()))
m=max(li)
sum=0
for i in range(n):
    sum+=li[i]
if m<sum-m:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
s = input().split()
s = [int(c) for c in s]
Sum = 0

Max = max(s)

for i in range(n):
    Sum += s[i]
    
if Max < Sum - Max:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

for i in range(N-1):
    sum_len = sum_len + int(L_i[i])

if sum_len > int(L_i[N-1]):
    print('Yes')
else :
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
list1 = []
goukei = 0
list1 = list(map(int, input().split()))
list1 = sorted(list1, reverse=True)
N_max = list1[0]
goukei = sum(list1[1:])
if N_max < goukei:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Ln = sorted(Ln,reverse=True)

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

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

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

n = int(input())

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

a.sort()

b = a.pop(-1)
 
if b < sum(a):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

L.sort()
L.reverse()
sumL = sum(L) - L[0]

if L[0] < sumL:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def solve(n_list):
    max_len = max(n_list)
    max_key = n_list.index(max_len)

    n_list.pop(max_key)
    else_len = sum(n_list)

    return "Yes" if else_len > max_len else "No"


def main():
    n = int(input())
    n_list = list(map(int, input().split()))

    ans = solve(n_list)
    print(ans)


main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
b = list(map(int, input().split()))
c = max(b)
d = sum(b) - max(b)

if c < d:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

print("Yes" if m[n - 1] * 2 < sum(m) else "No")

Submission status: Accepted

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

max_L = max(l)
sum_L = sum(l) - max_L

print('Yes' if sum_L > max_L else 'No')

Submission status: Accepted

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

max_l = max(L)
sum_l = sum(L) - max_l

if sum_l > max_l:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

n = int(input())

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in sys.stdin.readline().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v


# Width First Search (+ Distance)
def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk


# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def bisearch(L, target):
    low = 0
    high = len(L) - 1
    
    while low <= high:
        mid = (low + high) // 2
        guess = L[mid]
        if guess == target:
            return True
        elif guess < target:
            low = mid + 1
        elif guess > target:
            high = mid - 1
    if guess != target:
        return False

# --------------------------------------------

dp = None


def main():
    N = int(input())
    L = li_input()

    x = max(L)
    i = L.index(x)
    L_ = L[:i] + L[i+1:]

    if x < sum(L_):
        print("Yes")
    else:
        print("No")


main()

Submission status: Accepted

Solution code:
# coding: utf-8

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

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

Submission status: Accepted

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

longest = max(l)
total = sum(l) - longest

if longest < total:
    print("Yes")
else:
    print("No")