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:
import numpy as np
n = input()
n = int(n)
ls = input()
ls = ls.split()
for i in range(n):
  ls[i] = int(ls[i])


M = np.argmax(ls)
if (ls[M] < (sum(ls)-ls[M])):
    print("Yes")        
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(raw_input())
L = map(int, raw_input().split())
largest = max(L)
sum_l = 0
L.remove(max(L))
for i in range(0, N-1):
	sum_l += L[i]
ans = "Yes" if (largest < sum_l) else "No"
print ans

Submission status: Accepted

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

maxdata = max(llist)
llist.remove(maxdata)

if maxdata < sum(llist):
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

if max_L < sum_L:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

l.sort()

for i in range(n-1):
    sum += l[i]
if l[-1] < sum:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Ls, L_max = Ls[:-1], Ls[-1]
L_sum = sum(Ls)

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N=int(input())
L=input().split()
for i in range(len(L)):
    x=int(L[i])
    L[i]=x
#一番長い辺を求める。
#辺の長さの和を求める。
max=0
s=0
for i in range(len(L)):
    s+=L[i]
    if max<L[i]:
        max=L[i]
S=s-max
#判定
if max<S:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

def sol(n, S):
    maxi = max(S)
    ttl = sum(S)
    others = ttl - maxi
    print('Yes' if maxi < others else 'No')

test = False
if test:
    n = 4
    S =list( map(int, "3 8 5 1".split()))
    sol(n, S)

    n = 4
    S =list( map(int, "3 8 4 1".split()))
    sol(n, S)

    n = 10
    S =list( map(int, "1 8 10 5 8 12 34 100 11 3".split()))
    sol(n, S)


else:
    n = int(input())
    S =list( map(int, input().split()))
    #print(n, edges)
    sol(n, S)

Submission status: Accepted

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

l.sort()
lst.append(l[-1])

for i in range(0,n-1):
    lst2.append(l[i])

print("No") if sum(lst) >= sum(lst2) else  print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

def main():
    int(input())
    l = [int(e) for e in input().split(" ")]
    max_l = max(l)
    s = 0
    once = True
    for e in l:
        if e == max_l and once:
            once = False
            continue
        s += e

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

main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a = int(input())
array = list(map(int, input().strip().split(' ')))
array.sort()
array.reverse()
sum = 0
for i in range(a-1):
  sum = sum+array[i+1]

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

Submission status: Accepted

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

L2 = sorted(L)

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

Submission status: Accepted

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

max_num = max(num_li)
sum_num = sum(num_li)
ans_num = sum_num - max_num

if max_num < ans_num:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N = input()
list_L = list(map(int, input().split()))
longest = max(list_L)
list_L.remove(longest)
left = 0
for l in list_L:
    left += l
if longest < left:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

a.sort()
if a[-1] < sum(a[0:N-1]):
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
l = sorted([int(n) for n in input().split()], reverse=True)

other = 0
for i in range(1, n):
    other = other + int(l[i])

if int(l[0]) < other:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
l = input().split()
for i in range(n):
    l[i] = int(l[i])
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_v = max(L)
L.pop(L.index(max_v))
print('Yes' if sum(L) > max_v else 'No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
A = list(map(int, input().split()))
B = sorted(A,reverse=True)
if max(B) - sum(B) + max(B)  < 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
sides = [int(i) for i in input().split()]
maxside = max(sides)
sides.remove(maxside)
if maxside < sum(sides):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()
l=[int(i) for i in 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:
X = input()
Polygon = list(map(int, input().split()))

Polygon.sort(reverse = True)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
data = input().split()  
n = int(data[0])
#l = 
#l = map(lambda x: int(x), l)
l = [int(s) for s in input().split()]

sum=sum(l)
max=max(l)

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

Submission status: Accepted

Solution code:
N = input()
Ls = [int(v) for v in input().split()]

maxL = max(Ls)
Ls.remove(maxL)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

lengths = list(sorted(lengths))

# print(lengths)
max_length = lengths.pop()
# print(lengths)

if max_length < sum(lengths):
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
input()
Ls = [int(i) for i in input().split()]
max_arg = Ls.index(max(Ls))
sum_ = sum([v for i,v in enumerate(Ls) if i != max_arg])
print("Yes" if Ls[max_arg] < sum_ else "No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N=int(input())

l = sorted(list(map(int, input().split())))
maxL=l[-1]

sumL=sum(l[:-1])

if maxL<sumL:
	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 print("No")

Submission status: Accepted

Solution code:
n = int(input())

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

L.sort()

a = sum(L) - L[n-1]

if L[n-1] < a:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys

def main(inp):
    N=list(map(int,next(inp).split()))
    L=list(map(int,next(inp).split()))
    
    maxindex = [i for i , x in enumerate(L) if x==max(L)]
    
    maxi=L.pop(maxindex[0])
    
    if sum(L)>maxi:
        print("""Yes
""")
    else: print("""No
""")
      
main(sys.stdin)

Submission status: Accepted

Solution code:
N=int(input())

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

L.sort()

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

Submission status: Accepted

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

Submission status: Accepted

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

max_idx = -1
max_len = -1 
for i in range(N):
    if max_len < L[i]:
        max_len = L[i]
        max_idx = i
        
if sum(L) > max_len * 2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

L.sort()
L.reverse()

print("Yes" if sum(L) > int(2*L[0]) else "No")

Submission status: Accepted

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

max = 0
ignore = 0
temp = 0

for i, value in enumerate(li):
  if value > max:
    max = value
    ignore = i

for i, value in enumerate(li):
  if i == ignore:
    continue
  else:
    temp += value
    
if max < temp:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n = int(input())

l = input().split()

for i in range(len(l)):
    l[i] = int(l[i])

l.sort(reverse = True)

lmax = int(l[0])

lsum = 0

for i in range(len(l)):
    lsum += int(l[i])

lsum -= lmax

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

Submission status: Accepted

Solution code:
def read():
    N = int(input().strip())
    L = map(int, input().strip().split())
    return N, L


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


if __name__ == '__main__':
    inputs = read()
    print("%s" % solve(*inputs))

Submission status: Accepted

Solution code:
n = int(input())
line = input().split(" ")
l = []

for i in line:
    l.append(int(i))

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(sum(l)-max(l)>max(l)):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
a = input()
b = input().split()
c = []
for i in b:
    c.append(int(i))

c.sort()
sum = 0
for i in c:
    sum += i

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

Submission status: Accepted

Solution code:
N = int(input())

L = []

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

saidai = max(L)

goukei  = sum(L)

goukei = goukei - saidai

if saidai < goukei:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdin

n = stdin.readline().rstrip()
l = [int(x) for x in stdin.readline().rstrip().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_list=list(map(int, input().split()))

maxim=max(L_list)
L_list.remove(maxim)

if maxim<sum(L_list):
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
N = input()
_line = input()
line = _line.split()
S = 0.0
for i in range(int(N)):
  S += float(line[i])
tag=0
for i in range(int(N)):
  if S > float(line[i])*2:
    continue
  else:
    print("No")
    tag=1
    break
if tag==0:
  print("Yes")

Submission status: Accepted

Solution code:
# 整数の入力
N = int(input())
L = list(map(int,input().split()))

Lmax = max(L)

Lsum = 0

for i in range(N):
      Lsum = Lsum  +L[i]
Lsum = Lsum  -Lmax 
   

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

Submission status: Accepted

Solution code:
import sys, copy, math, collections, itertools
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:
Rep = int(input())
rawdata = [int(i) for i in input().split()]
a = max(rawdata)
b = sum(sorted(rawdata, reverse=True)[1:Rep])
if a < b:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
a.sort()
x = a.pop()
y = sum(a)
if x < y:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# B
# 
# input
n = int(input())
l = list(map(int,input().split()))
# output
if sum(l) - max(l) * 2 > 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
a=input()
c=input()
b=c.split()
b=[int(i) for i in b]
b.sort()
mn=2*b[-1]
s_n=sum(b)
if mn<s_n:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

# L = [1, 8, 10, 5, 8, 12, 34, 100, 11, 3]
# L = [3, 8, 5,1]

max_L = max(L)
L.remove(max_L)
# print(L, max_L)
# print(sum(L))
op = "Yes" if max_L < sum(L) else "No"
print(op)

Submission status: Accepted

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

#最長辺を最初に出す
L.sort()
L.reverse()

#最長辺以外の辺の長さの和を求める
sum = 0
for j in range(1,N):
    sum += L[j]

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

Submission status: Accepted

Solution code:
l = 0
N = int(input())
L = [int(x) for x in input().split()]
L.sort()
for i in range(N - 1):
    l += L[i]
if l > L[N-1]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
#import numpy as np
n = int(input())
l = list(map(int, input().split()))
a = max(l)
l.remove(a)

c = sum(l)
if a < c:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

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

Submission status: Accepted

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


L_max = max(L_int)

max_index = L_int.index(max(L_int))
L_int[max_index] = 0

if int(L_max) < int(sum(L_int)):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
#ABC117B-Polygon.py
import numpy as np

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

L_max = max(L)
L_total = np.sum(L)

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

Submission status: Accepted

Solution code:
n = int(input())
list = list(map(int, input().split()))
for i in range(n):
    if list[i] >= sum(list[:i])+sum(list[i+1:]):
        print('No')
        quit()
print('Yes')

Submission status: Accepted

Solution code:
n = int(input())
lstr = input().split()
ldec = []
sum = 0

for ls in lstr:
    sum += int(ls)
    ldec.append(int(ls))

lmax = max(ldec)

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

Submission status: Accepted

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

list.sort(reverse = True)

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

Submission status: Accepted

Solution code:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
import numpy as np

sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]


def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    N = I()
    L = LI()

    max_line = np.argmax(L)
    if L[max_line] < sum([i for idx, i in enumerate(L) if idx != max_line]):
        print("Yes")
    else:
        print('No')



main()

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 = sum + l[i]

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

Submission status: Accepted

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

l_max = max(l)
index_max = l.index(l_max)

sum = sum(l) - l_max

if (sum > l_max):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

n = input()
l = [int(i) for i 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(int(x) for x in input().split())
s = 0
for i in range(n):
    s += l[i]
s -= max(l)

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

Submission status: Accepted

Solution code:
a = input()
b = input().split()
b = [int(n) for n in b]
b = sorted(b)
m = b.pop(-1)
if m < sum(b):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

maxL = max(L)
sumL = 0
for tmpL in L:
    sumL = sumL + tmpL

if sumL - maxL > maxL:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
L = [int(x) for x in input().split(' ')]
myarray = np.array(L)
Lmax = np.max(myarray)
Lsum = np.sum(myarray) - Lmax
if Lmax < Lsum:
    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 suml > lmax :
    print("Yes") 
else: 
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
L = [int(x) for x in input().split()]
L.sort()
max_length = L[len(L)-1]
L[len(L)-1] = 0
other_length_sum = sum(L)
if max_length<other_length_sum:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

if sum(b) > max_b:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N = int(input())

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

L.sort()

sum_ = 0
for l in L[:-1]:
    sum_ += l
if 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.reverse()
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:
import numpy as np
n = int(input())
l = list(map(int,input().split()))
lmax = np.argmax(l)
if l[lmax] < sum(l)-l[lmax]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N=int(input())
Y=input()#1行に沢山の数値(または文字)が並んでいる場合にリストに格納していく
X=[]
X=Y.split(" ") #数値YをリストXに格納
Z=[int(i) for i in X] #リストXの要素を"文字"から"数値"に変換
Z=sorted(Z,reverse=True) #リスト内の要素を大→小にソート
a=0
for i in range(1,N):
     a=a+Z[i]
if a>Z[0]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
from sys import stdin

N = int(stdin.readline().rstrip())
Ls = [int(x) for x in stdin.readline().rstrip().split()]

Ls.sort(reverse=True)

maxv = Ls[0]
sum = 0
for x in Ls[1:]:
    sum = sum + x
    
if maxv < sum:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
_ = input()
input_line = input()

# main

numbers = [int(element) for element in input_line.split(' ')]

numbers.sort()

longest = numbers.pop()
sum_rest = sum(numbers)

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

Submission status: Accepted

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

Max = max(L)
L.remove(Max)       
if(sum(L) > Max):
    print("Yes")
else:  
    print("No")

Submission status: Accepted

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

res = 'Yes'
for i in range(N):
	if L[i] >= sum(L[:i]) + sum(L[i + 1:]):
		res = 'No'

print(res)

Submission status: Accepted

Solution code:
import sys

lines = sys.stdin.readlines()
N = int(lines[0])
L = [int(x) for x in lines[1].split()]

max_L = max(L)

print('Yes' if sum(L, -max_L) > max_L else 'No')

Submission status: Accepted

Solution code:
N = input()
N = int(N)


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

lenmax = 0
for i in range(N):
	if (lenmax < L[i]):
		lenmax = L[i]
		intmax = i

sumother=0
for i in range(N):
	if (i!= intmax):
		sumother += L[i]

if(sumother > lenmax):
	print('Yes')
else:
	print('No')

Submission status: Accepted

Solution code:
import numpy as np


n = input()
a = list(int(i) for i in input().split())  
arg = np.argmax(a)
max_a = a[arg]
a = np.delete(a,arg)
if np.sum(a) >max_a:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
def li(): return map(int, stdin.readline().split())
def ni(): return int(stdin.readline())

N = ni()
L = tuple(li())
L_MAX = max(L)
SUM = sum(L)
if 2*L_MAX < SUM:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N = int(input())
numlist = list(map(int,input().split()))
numlist.sort()
sumnum = 0
for i in range(N-1):
    sumnum += numlist[i]
if max(numlist) < sumnum:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
length = input().strip().split()
i_length = [int(s) for s in length]
max_value = max(i_length)
sum_value = sum(i_length)

if max_value < sum_value - max_value:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

a_max = max(a)
a_max_index = a.index(max(a))

check = 0
for i,j in enumerate(a):
    if i != a_max_index:
        check += j
        
if check > a_max:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

l.sort(reverse=True)
a = 0

for n in range(1, n):
    a += l[n]

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

Submission status: Accepted

Solution code:
n=int(input())
s=list(map(int,input().split(" ")))
s.sort(reverse=True)
sum=0
for i in range(1,n):
  sum+=s[i] 
if s[0]<sum:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

max_l = max(l)
all_s = sum(l)
if (all_s - max_l*2)>0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int,input().split()))
print("YNeos "[(max(L) >= (sum(L) - max(L)))::2])

Submission status: Accepted

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

L_list.sort()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
sorted_L = sorted(L)
high = sorted_L[-1]
sorted_L.pop(-1)


if high < sum(sorted_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()))
Lm = max(L)
if 2 * Lm < sum(L):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Feb  3 21:02:18 2019

@author: doppe
"""

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

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

Submission status: Accepted

Solution code:
n = int(input()) #n行の入力をリストに入れる
l = list(map(int, input().split()))

ld = sorted(l, reverse=True)
if max(ld) < sum(ld) - max(ld):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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


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

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

Submission status: Accepted

Solution code:
import numpy as np

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

L_list = L_list

max_idx = np.argmax(L_list)
sum_edges = np.sum(L_list)

if sum_edges > 2 * L_list[max_idx]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = input()
a = input().split()
a = [int(_) for _ in a]
a.sort()
b = a.pop()
c = sum(a)
if c > b:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(raw_input())
q = map(int,raw_input().split())

m = max(q)
q.remove(m)
m2 = 0
for a in q:
  m2 += a
if m < m2:
  print "Yes"
else:
  print "No"

Submission status: Accepted

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

import numpy as np
print('Yes' if L.pop(np.argmax(L)) < sum(L) else 'No')

Submission status: Accepted

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

import sys, re
from collections import deque, defaultdict, Counter
from math import sqrt, hypot, factorial, pi, sin, cos, radians
if sys.version_info.minor >= 5: from math import gcd
else: from fractions import gcd 
from heapq import heappop, heappush, heapify, heappushpop
from bisect import bisect_left, bisect_right
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from functools import reduce, partial
from fractions import Fraction
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def ceil(a, b=1): return int(-(-a // b))
def round(x): return int((x*2+1) // 2)
def fermat(x, y, MOD): return x * pow(y, MOD-2, MOD) % MOD
def lcm(x, y): return (x * y) // gcd(x, y)
def lcm_list(nums): return reduce(lcm, nums, 1)
def gcd_list(nums): return reduce(gcd, nums, nums[0])
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N = INT()
L = LIST()
L.sort(reverse=True)

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

Submission status: Accepted

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

lmax = ls[-1]
lsum = sum(ls[:-1])

print('Yes' if lmax < lsum else 'No')

Submission status: Accepted

Solution code:
from sys import stdin

N = int(stdin.readline().rstrip())
L = [int(x) for x in stdin.readline().rstrip().split()]

sortL = sorted(L, reverse=True)
if sortL[0] < sum(sortL[1:N]):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
input()

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

if sum - max > max:
    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(0,n-1):
    s+=l[i]
if s <= l[n-1]:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
N = int(input())

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

L.sort()
L.reverse()

max_l = L[0]

sum_l = sum(L) - max_l

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

Submission status: Accepted

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

ll.sort()
longest=ll[len(ll)-1]

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