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: Runtime Error

Solution code:
# import bisect
# import heapq
# import math
# import random
# from collections import Counter, defaultdict, deque
# from decimal import Decimal
# from functools import lru_cache, reduce
# from itertools import combinations, combinations_with_replacement, product, permutations
# from operator import add, mul, sub, itemgetter
# import numpy as np

import sys
sys.setrecursionlimit(10000)

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

def read_int(input):
	if input == None:
		input = sys.stdin.readline().strip()
	ret = [int(x) for x in input.split()]
	if len(ret) == 1:
		ret = ret[0]
	return ret

def read_float(input):
	if input == None:
		input = sys.stdin.readline().strip()
	ret = [float(x) for x in input.split()]
	if len(ret) == 1:
		ret = ret[0]
	return ret
	
def read_str(input):
	if input == None:
		input = sys.stdin.readline().strip()
	ret = [x for x in input.split()]
	if len(ret) == 1:
		ret = ret[0]
	return ret
		
@mt
def slv(*args): 
	# 処理
	# ここから
	
	if max(L) < sum(L) - max(L):
		ans = 'Yes'
	else:
		ans = 'No'
	
	# ここまで
	return ans

if __name__ == '__main__':
	
	# テスト用入力
	t = '''4
3 8 5 1'''.splitlines()
	
	# 入力 (変数= read_xxx(test[行数]))
	# ここから
	
	N = read_int()
	L = read_int()
	
	# ここまで
		
	# 出力
	# ここから
	
	print(slv(N, L))
	
	# ここまで

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
if int(kaku) != len(s_list):
    print('No')
else:
    hen_list = [int(x) for x in s_list]

    m = max(hen_list)
    total = sum(hen_list)
    print(m, total)

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
input();s=map(int,input().split());print('YNeos'[sum(s)-max(s)*2<1::2])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

lm = 0
ls = 0
for i in range(0, n):
  if lm < l[i]:
    lm = l[i]
  ls = ls + l[i]
ls = ls - lm

if lm < ls:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

lm = 0
for i in range(0, n):
  if lm < l[i]:
    lm = l[i]

ls = -1 * lm
for i in range(0, n):
  ls = ls + l[i]

if lm < ls:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
input();s=map(int,input().split());print('YNeos'[sum(s)-max(s)*2<1::2])

Submission status: Runtime Error

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

if l.count(max(l)) >= 2:
    print("No")
    break
elif max(l) < sum(l) - max(l):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

max_ = list_L.pop(list_L.index(max(list_L)))

if max_ > sum(list_L):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

if l.count(max(l)) >= 2:
    print("No")
    b
elif max(l) < sum(l) - max(l):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
N = input()
lines = input().split(' ')
rest = sum(lines) - max(lines)

if max(lines) <= rest:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
x=list(map(int,input().split()))
if n==1:
    print(max(x)-min(x))
elif m==1 or n>=m:
    print(0)
else:
    goukei=0
    l=[0]
    i=0
    x.sort()
    a=0
    b=0
    while i<m-1:
        a=x[i]
        b=x[i+1]
        goukei+=b-a
        l.append(b-a)
        i+=1
    for v in range(n-1):
        goukei-=max(l)
        l.remove(max(l))
    print(goukei)

Submission status: Runtime Error

Solution code:
N=int(input())
a=input()
num=[]
num.append(int(a.split()[0]))
num.append(int(a.split()[1]))
num.append(int(a.split()[2]))
num.append(int(a.split()[3]))

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: Runtime Error

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

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
# Nの取得
index = int(input())
 
# n回ループして配列に入れる
max = 0
other = 0
l =　input().split()
for i in range(n):
 tmp = l[i]
 max = tmp if tmp > max else other = other +  l[i]
 
if max < tmp:
 print("Yes")
else: 
 print("No")

Submission status: Runtime Error

Solution code:
from sys import stdin

n = int(stdin.readline().rstrip())
data = map(int, stdin.readline().rstrip().split())

def is_s(hens):
  m = max(hens)
  hens.remove(m)
  if m < sum(hens):
  	return True
  else:
    return False

pritn(is_s(data))

Submission status: Runtime Error

Solution code:
s = int(input())
n = int(1)
string_list = [input().split() for i in range(n)]
int_list = [int(s) for s in string_list]
m = max(int_list)
if sum(int_list) - int(m) > int(m):
    print("Yes")
else:
    print("NO")

Submission status: Runtime Error

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

# n回ループして配列に入れる
max = 0
other = 0
for i in range(n):
  tmp = input()
  max = tmp if tmp > max else other = other +  tmp

 if max < tmp  :
   print("Yes")
else : 
print("No")

Submission status: Runtime Error

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

# n回ループして配列に入れる
max = 0
other = 0
for i in range(n):
  tmp = input()
  max = tmp if tmp > max else other = other +  tmp

print("Yes") if max < tmp else print("No")

Submission status: Runtime Error

Solution code:
n=int(input())

l=[]
for i in range(n):
  l.append(int(input()))

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

if a<0 :
  print("Yes")
  
else:
  print("No")

Submission status: Runtime Error

Solution code:
s = int(input())
n = "1"
string_list = [input() for i in range(n)]
int_list = (int(s) for s in string_list)
m = max(int_list)
if sum(int_list) - int(m) > int(m):
    print("Yes")
elif print("NO")

Submission status: Runtime Error

Solution code:
n = int(input())
p = list(map(int, input().split(' ')))
p = sorted(p, reverse=True)
if len(p) != n or n < 4:
  raise ValueError

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = int(input())
n = "1"
string_list = [input() for i in range(n)]
int_list = (int(s) for s in string_list)
m = max(int_list)
if sum(int_list) - int(m) > int(m)
else print("Yes")
elif print("NO")

Submission status: Runtime Error

Solution code:
n = int(input())
l = list(map(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: Runtime Error

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

l.sort(reverse = True)

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

  del l[0]

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

Submission status: Runtime Error

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

def judge(n,l):
    for i in range(n):
        for j in range(j):
            s = 0
            if(j!=i):
                s += l[j]
            if(s>l[i]):
                print('No')
                return
    print('Yes')
    return

Submission status: Runtime Error

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

max_num = max(a)
num = 0
for i in a:
  if(max_num !== i):
    num += i
    
if(num > max_num):
  print(Yes)
else:
  print(No)

Submission status: Runtime Error

Solution code:
n = int(input())
a = input().split()
i = 0
while i < 4:
  a[i] = int(a[i])
  i = i + 1 

i = 0
while i < 4:
  j = i + 1
  while j < 4:
    if a[i] < a[j]:
      temp = a[i]
      a[i] = a[j]
      a[j] = a[i]
    j = j + 1
  i = i + 1

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

Submission status: Runtime Error

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

l.sort(reverse = True)

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

  del l[0]

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

Submission status: Runtime Error

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

l.sort(reverse = True)

lm = l[0]

del l[0]

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
p = [int(input()) for i in range(n)]
p = sorted(p)
if p[0] < sum(p[1:]):
	print('Yes')
else:
	print('No')

Submission status: Runtime Error

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

l.sort(reverse=true)

lm = l[0]
del l[0]

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

Submission status: Runtime Error

Solution code:
n = int(input())
lis = [input() for _ in range(n)]

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

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

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

Submission status: Runtime Error

Solution code:
N=int(input())
Ls=input().split()
mx=max(Ls)
start=0
for i in Ls:
  start+=(N-int(i))
if start>mx:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

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

judge = sum - max(li) -max(li)

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

Submission status: Runtime Error

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("%f" % solve(*inputs))

Submission status: Runtime Error

Solution code:
import numpy as np
N = input()
Ls = np.array([int(i) for i in input().split()])
max_arg = np.argmax(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: Runtime Error

Solution code:
n = input()
EdgeLength=input()
edgeLength=[int(i) for i in EdgeLength]
N = int(n)

sorted(edgeLength)

sumL = 0
sumLength = [sumL += edgeLength[i] for i in range(N-1)]

if edgeLength[N] < sumL:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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: Runtime Error

Solution code:
n = input()
EdgeLength=input()
edgeLength=[int(i) for i in EdgeLength]
N = int(n)

sorted.edgeLength()

sumL = 0
sumLength = [sumL += edgeLength[i] for i in range(1,N)]

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

Submission status: Runtime Error

Solution code:
import numpy as np
input()
Ls = np.array([int(i) for i in input().split()])
max_arg = np.argmax(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: Runtime Error

Solution code:
n = int(input())
li = list(map(int,input().split()))
maxli = max(li)
judge = np.sum(li) - maxli - maxli
if judge > 0:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
EdgeLength=input()
edgeLength=[int(i) for i in EdgeLength]

sorted.edgeLength()

sumL = 0
sumLength = [sumL += edgeLength[i] for i in range(1,len(edgeLength))]

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

Submission status: Runtime Error

Solution code:
import numpy as np
n = int(input())
l = list(map(int, input().split()))
a = max(l)
b = l.remove(a)
c = np.sum(b)
if a < c:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
num = int(input())
lens = [int(a) for a in input().split(' ')]
max_len = max(len)
lens.remove(max_len)
sum_lens = sum(lens)

if max_len < sum_lens:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
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: Runtime Error

Solution code:
n=int(input())
l=list(map(int,input().split()))
ans="Yes"
for i in l:
  if i>=sum(L)-i:
    ans="No"
print(ans)

Submission status: Runtime Error

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

ok = True

for i in range(N):
  if a[i] >= sum(a) - a[i]:
    ok = False

print("Yes" if ok else "No")

Submission status: Runtime Error

Solution code:
n = int(input())
polys = []
for i in range(n):
        polys.append(int(input()))

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