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:
# _*_ coding:utf-8 _*_
#  Atcoder_Beginner_Contest117-B
#  TODO https://atcoder.jp/contests/abc117/tasks/abc117_b

def solveProblem(lengthList):
	sortedList = sorted(lengthList,reverse=True)
	allIntegerSum = sum(lengthList)
	maxInteger = sortedList.pop(0)
	anotherIntegerSum = allIntegerSum - maxInteger
	if maxInteger < anotherIntegerSum:
		answer="Yes"
	else:
		answer="No"
	return answer

if __name__ == '__main__':
	_ = input()
	lList = list(map(int,input().strip().split(' ')))
	solution = solveProblem(lList)
	print("{}".format(solution))

Submission status: Accepted

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

Submission status: Accepted

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

Ld = sorted(L, reverse=False)

L_other=0
for i in range(N-1):
  L_other += Ld[i]

if (Ld[N-1] < L_other):
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

L.sort()
if L[N - 1] < sum(L[: N - 1]):
    print("Yes")
else:
    print("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()]
max = max(l)
sum = sum(l, -1*max)
print("Yes") if sum > max else print("No")

Submission status: Accepted

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

Submission status: Accepted

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

num.sort()
b=0
for i in range(len(num)-1):
  b+=num[i]
if(num[len(num)-1]<b): print('Yes')
else: print('No')

Submission status: Accepted

Solution code:
n = int(input())
b = list(map(int, input().split()))
c = max(b)
s = sum(b)

if c * 2 - s < 0:
	print('Yes')
else:
	print('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()]
max = max(l)
sum = sum(l, -1*max)
if sum > max:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
x = sorted(list(map(int, input().split())))
sum = 0
if len(x) < n:
    print('No')
else:
    for i in range(0, len(x) - 1):
        sum += x[i]
    if sum > x[len(x) - 1]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

L.sort()
L.reverse()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

lmax = max(l)
l.remove(lmax)
if sum(l) > lmax:print("Yes")
else: print("No")

Submission status: Accepted

Solution code:
from sys import stdin
 
n = int(stdin.readline().rstrip())
data = list(map(int, stdin.readline().rstrip().split()))
 
def is_s(hens):
  m = max(hens)
  hens.remove(m)
  if m < sum(hens):
  	return "Yes"
  else:
    return "No"
 
print(is_s(data))

Submission status: Accepted

Solution code:
n=int(input())
l=[int(i) for i in input().split()]
ans=0
lmax=max(l)
maxindex=l.index(lmax)

for i in range(n):
    if i!=maxindex:
        ans+=l[i]

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

Submission status: Accepted

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

L_sum = sum(L)

res = True
for l in L:
    if ((L_sum - l) <= l):
        res = False

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

Submission status: Accepted

Solution code:
N = int(input())
# L = []

# L = map(int, input().split())
# = list(map(int, input().split()))
L = [int(i) for i in input().split()]
#L.append(int(input()))
#s = 0
#for x in L:
    #s = s + x
#print(s)

# print(a/b)
#print(L)
s = sum(L)
m = max(L)
#print(s)
#print(m)
#f = 0
#for x in L:
#    if(x > s - x):
#        f = 1

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

Submission status: Accepted

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

# 整数の入力
N = int(input())
# スペース区切りの整数の入力
#b, c = map(int, input().split())
l = list(map(int, input().split()))
max = max(l)
#for i in l:
#    print(i)

num = 0
for i in l:
    num=i+num
num = num-max
#print(num)
#print(max)
if num > max:
    print("Yes")
else:
    print("No")
# 文字列の入力
#s = input()
# 出力
#print("{} {}".format(a+b+c, s))

Submission status: Accepted

Solution code:
n, = [int(i) for i in input().strip().split(" ")]
ls = [int(i) for i in input().strip().split(" ")]
l = max(ls)
l2 = sum(ls)
if l2 - l > l:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    n = int(input())
    ls = sorted((int(x) for x in input().split()), reverse=True)
    if ls[0] < sum(ls[1:]):
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
def main() :
    N = int(input())
    l_list = [int(i) for i in input().split()]
    max_len = max(l_list)
    sum_len = sum(l_list) - max_len

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

main()

Submission status: Accepted

Solution code:
N = int(input())
L = input().split(" ")
max = 0
sum = 0
tmp = 0
for i in range(N):
    tmp = int(L[i])
    sum += tmp
    if tmp > max:
        max = tmp

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

Submission status: Accepted

Solution code:
N = input()
L = map(int,raw_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()))
nagai = int(max(L))
wa = int(sum(L))
if nagai < wa - nagai:
   print('Yes')
else:
   print('No')

Submission status: Accepted

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

Submission status: Accepted

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

new_list = sorted(list, reverse=True)

x = 0
for i in new_list[1:len(new_list)]:
    x += i

if new_list[0] < x:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = input()
L_i = list(int (x) for x in input().split())

Lmax = max(L_i)
if((int(sum(L_i)) - Lmax) > Lmax):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

m = max(l)

s = 0
find = False
for num in l:
    if num == m and not find:
        find = True
    else:
        s += num

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(10000)


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, L):
    return 'Yes' if sum(L) - max(L) > max(L) else 'No'


def main():
    N = read_int()
    # N, M = read_int_n()
    # A = [read_int_n() for _ in range(N)]
    L = read_int_n()
    print(slv(N, L))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input())
a=str(input())
l=[]
l=list(map(int,a.split()))

l.sort()
l.reverse()
plus=0
for i in range(n):
    if i==0:
        pass
    else:
        plus+=l[i]
if l[0]<plus:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

l.sort()

a = 0
i = 0
while i < n - 1:
  a += l[i]
  i += 1

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(n):
  if max_num < l[i]:
    max_num = l[i]
    max_index = i

l.pop(max_index)

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

if total > max_num: print("Yes")
else: print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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 sum <= L[0]:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().rstrip().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:
def judge(n,l):
    for i in range(n):
        s = 0
        for j in range(n):
            if(j!=i):
                s += l[j]
        if(s<=l[i]):
            print('No')
            return
    print('Yes')
    return

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    N = int(lines.pop(0))
    L = list(map(int, lines.pop(0).split(' ')))
    L.sort()
    longest = L.pop(-1)
    if longest < sum(L):
        print('Yes')
    else:
        print('No')

#
# main
#
lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

L_sum = sum(L)

if L_sum - L_max > L_max:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

l.sort(reverse = True)

if len(l) == n:
  lm = l[0]

  del l[0]

  if int(lm) < sum(l):
    print('Yes')
  else:
    print('No')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input() #N角形
sides_length = input().split()
sides_length = [int(i) for i in sides_length]
sides_total = 0
#定理:一番長い辺が他の N-1辺の長さの合計よりも真に短い場合に限り、条件を満たすN角形が描ける。
for i in range(int(N)):
    sides_total += int(sides_length[i])
sides_max = max(sides_length)
total_Nomax = int(sides_total) - int(sides_max)

if int(sides_max) < int(total_Nomax):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

    sum_l = sum(l)
    for a in l:
        if a >= sum_l - a:
            return "No"
    return "Yes"

print(f())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num = int(input())
edges = list(map(int, input().split(' ')))
answer = "Yes"
for edge in edges:
    if sum(edges) <= edge * 2:
        answer = "No"
        break
print(answer)

Submission status: Accepted

Solution code:
print((lambda l:['No','Yes'][sum(l[:-1])>l[-1]])(sorted(list(map(int,input().split()+input().split()))[1:])))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
str = input()
all = str.split()
L_all= [int(s) for s in all]
L_all = sorted(L_all)
other = L_all[:n-1]
L_sum=sum(other)
last = L_all[n-1]
if L_sum > last:
    print("Yes")
if L_sum <= last:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
Ls = input().split()
for i in range(N):
    Ls[i] = int(Ls[i])
max_L = max(Ls)
sum_others = sum(Ls) - max_L
if max_L < sum_others:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

max_L = max(LList)
isFirstMax_L = 0
sumOtherL = 0

for i in LList :
    if i == max_L and isFirstMax_L == 0:
        isFirstMax_L = 1
        continue
    sumOtherL += i

if max_L < sumOtherL :
    print("Yes")
else :
    print("No")

Submission status: Accepted

Solution code:
a = int(raw_input())
b = raw_input()
num_list_str = b.split(" ", a)
num_list = [int(s) for s in num_list_str]
maxnum = max(num_list)
num_list.remove(maxnum)
if maxnum < sum(num_list):
  print "Yes"
else:
  print "No"

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    k = [int(s) for s in input().split()]
    k.sort(reverse=True)

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

main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
times=int(input())
side=input().split(" ")
maax=0
suum=0
check=0
for i in side:
    suum+=int(i)

for i in side:
    if suum-int(i)<=int(i):
        check+=1
        break;

if check==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
EdgeLength=input().split()
#print(EdgeLength)
N = int(n)
EdgeLength = [int(i) for i in EdgeLength]

#list(map(int, EdgeLength))

EdgeLength.sort()
#print(EdgeLength)

sumL = sum(EdgeLength) - EdgeLength[N-1]
#print(sumL)


if EdgeLength[N-1] < sumL:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
X = map(int, input().split())
Y = []
for i in X:
    Y.append(i)
sum_x = sum(Y)
max_len = max(Y)

if sum_x > max_len * 2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int, input().split()))
l = sorted(l,reverse=True)
sum1 = 0
for i in range(1,len(l)):
    sum1 += l[i]
if sum1 > l[0]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

from collections import deque
import itertools as it
import sys
import math

sys.setrecursionlimit(1000000)

N = input()
L = map(float, raw_input().split())

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

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
maxind = a.index(max(a))
maxnum = a[maxind]
tmp = 0
for i in range(len(a)):
    if i == maxind:
        continue
    tmp += a[i]
msg = 'No'
if maxnum < tmp:
    msg = 'Yes'
print(msg)

Submission status: Accepted

Solution code:
import numpy as np

m = list(map(int, input().split()))
m2 = list(map(int, input().split()))
n = m[0]
l = m2

lnp = np.asarray(l)
lmax = np.max(lnp)
lsum = np.sum(lnp) - lmax

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

Submission status: Accepted

Solution code:
s = [input() for i in range(2)]
sides = [int(i) for i in s[1].split()]
sides = sorted(sides,reverse=True)
long_side= sides.pop(0)

total = 0
for side in sides:
  total += side
  
if long_side < total:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N=input().rstrip().split(" ")
lst=input().rstrip().split(" ")
int_lst=[]
N_sum=0

for i in range(len(lst)):
    int_lst.append(int(lst[i]))
int_lst.sort(reverse=True)

for i in range(len(lst)-1):
  N_sum+=int(int_lst[i+1])

if int_lst[0] < N_sum:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = input()
a = list(map(int, input().split()))
a.sort()
max = a.pop()
sum = 0
for b in a:
    sum += b
if sum > max:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

max = max(l);
l.remove(max);

all = 0

for p in l:
    all+=p

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

Submission status: Accepted

Solution code:
n = int(input())
a = map(int,input().split())
a = sorted(a)
a = reversed(a)
a = list(a)
b = "Yes"
c = 0
for i in range(1,n):
     c += a[i]
if a[0] >= c:
    b = "No"
print(b)

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
Amax=max(A)
wa=0
for i in A:
    wa=wa+i
if wa>Amax*2:print("Yes")
else:print("No")

Submission status: Accepted

Solution code:
import math
import sys
n = int(raw_input())
l = map(int, raw_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:
# - coding : utf-8 -*-

n = int(input())
lst_str = input().split()
lst = []
for elem in lst_str:
    lst.append(int(elem))
lst.sort()

max_ = int(lst[-1])
for elem in lst[0:-1]:
    max_ = max_ - int(elem)
if max_ < 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
L = [int(i) for i in input().split()]
s = 0
for i in range(N):
    s+=L[i]
if max(L)<s-max(L):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys
N = None

for i,line in enumerate(sys.stdin):
    if i == 0:
        N = int(line)
    if i == 1:
        lines = [int(i) for i in line.split(" ")]
        if (sum(lines) - max(lines)) > max(lines):
            print("Yes")
        else:
            print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

if hoka > naga:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
li = list(map(int, input().split()))
new_li = sorted(li, reverse=True)
count = 0
max = new_li[0]

for i in new_li:
	count += i

count -= max

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

for i in range(len(L)):
    L[i] = int(L[i])
    s += int(L[i])

s -= int(max(L))

if s > int(max(L)):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
L_list = list(map(int, input().split()))

max_ = max(L_list)
L_list.remove(max_)

if max_ < np.sum(L_list):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

max = max(l)

sum = sum(l)
sum = sum - max

if max < sum:
    print("Yes")

else:
    print("No")

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

if (sum(li) - max(li)) > max(li) :
    print("Yes")

else :
    print("No")

Submission status: Accepted

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

num = int(input())

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

def get_max(sides):
    idx = 0
    _max = sides[idx]
    
    for i, side in enumerate(sides):
        if _max < side:
            _max = side
            idx = i
    return idx, _max
    
idx, _max = get_max(sides)

total = 0
for i, side in enumerate(sides):
    if i == idx:
        continue
    total += side
    
if _max < total:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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


from sys import stdin

############################################
#from sys import stdin
import numpy as np

# read data for n sequences.
n = int(stdin.readline())
data = np.zeros(n)
d = stdin.readline().split()
for i,x in enumerate(d):
    data[i] = int(x)

max = np.max(data)
if max >= (np.sum(data)-max):
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

sum = 0

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

judge = sum - max(lis) - max(lis)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

m = max(L)
L.pop(L.index(m))
add = sum(L)
if m < add:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

l_max = max(l_list)
result = "Yes"

if(l_max >= sum(l_list)-l_max):
    result = "No"

print(result)

Submission status: Accepted

Solution code:

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

Lmax = max(Ln)

Ln.remove(Lmax)

if Lmax < sum(Ln):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def inpl():
    return list(map(int, input().split()))


N = int(input())
L = inpl()

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

Submission status: Accepted

Solution code:
N = int(input())
incoming = [int(i) for i in input().split(' ')]
max_val = max(incoming)
sum_val = sum(incoming) - max_val

if(max_val < sum_val):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
def i1():
 return int(input())
def i2():
 return [int(i) for i in input().split()]
n=i1()
l=i2()
ls=sum(l)
s=0
for i in l:
  if ls-2*i<=0:
    s=1
if s==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import copy
import itertools

def funcF(p):
    return p

def funcG(p):
    return funcF(p) + p*p

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


S=0
for i in L[:N-1]:
    S += i

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

Submission status: Accepted

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

# sort
L = list(reversed(sorted(L)))

longest = L[0]
add = 0
for n in L[1:]:
    add += n
if add > longest:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import sys
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:
def judge(N,L):
    max_length = 0
    max_index = -1
    for i in range(N):
        if(L[i]>max_length):
            max_length = L[i]
            max_index = i
    del L[max_index]
    
    if(sum(L)>max_length):
        return print('Yes')
    else:
        return print('No')
    
if __name__ == '__main__':
    N = int(input())
    L = input().split()
    for i in range(N):
        L[i] = int(L[i])
    judge(N,L)

Submission status: Accepted

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

lmax = max(l)
lsum = -lmax
for i in l:
    lsum += i

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

Submission status: Accepted

Solution code:
N=int(input())
L=list(int(i) for i 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()))

summ = 0
n = l[0]

for i in l[1:]:

  if n < i:  
    summ += n
    n = i
   
  else:
    summ += i
    
if n < summ:
  print('Yes')
  
else:
  print('No')

Submission status: Accepted

Solution code:
a=int(input())

length=list(map(int,input().split()))
#print(length)
maximum=int(max(length))
goukei=int(sum(length))
#print(maximum)
#print(sum(length))
#print(goukei)

if 2*maximum<goukei:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N = int(input())
L = input().split()
Lng=0
sumL=0
for i in range(N):
    if Lng<int(L[i]):
        sumL=sumL+Lng
        Lng=int(L[i])
    else:
        sumL=sumL+int(L[i])
    # print("Lng="+str(Lng))
    # print("sumL="+str(sumL))
if Lng<sumL:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
input()

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

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

Submission status: Accepted

Solution code:
N = input().rstrip()
N = int(N)
num = N-1
Line = input().rstrip().split()
line = [int(s) for s in Line]
line.sort()
MAX = line[num]
line.pop(num)

SUM = sum(line)

if MAX < SUM :
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

l.sort(reverse = True)

max = l[0]
sum = 0
for i in range(1, n):
  sum += l[i]
  
if sum > max:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N_corner = int( input() )
  
line = input()

line_value = line.split()
line_value = [ int(value) for value in line_value ]

longest = int( max( line_value ) )

total = sum(line_value)

rest = total - longest

if longest < rest:
  print('Yes')
else :
  print('No')