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:
# B
def main(L_list, N):
    if sum(L_list) > max(L_list)*2:
        return "Yes"
    else:
        return "No"
    
if __name__ == "__main__":
    N = int(input())
    L_list = list(map(int, input().split()))
    res = main(L_list, N)
    print(res)

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
for i in range(N):
    l = L[i]
    if 2*l < sum(L):
        pass
    else:
        print('No')
        break
else:
    print('Yes')

Submission status: Accepted

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

t = max(L)
p = 2*t

for i in range(0,len(L)):
    p -= L[i]

if p >= 0:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input()
ls = list(map(int, input().split()))
ls.sort()
mx = ls.pop()
sm = sum(ls)
if mx < sm:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

m = max(L)
s =sum(L) - m
# print(L)
# print(m)
# print(s)
if m < s:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())

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

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

Submission status: Accepted

Solution code:
n = int(input())

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

sides.sort()

total = sum(sides)-max(sides)

if sides[-1] < total:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

L.sort(reverse=True)
if L[0] < sum(L[1:]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdin

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

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

input = lambda: stdin.readline()
main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
n = int(input())
l = input().split()
for i in range(n):
    l[i] = int(l[i])
l.sort()
sum = 0
for i in range(n-1):
    sum += l[i]
if l[n-1] < sum:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
llist = [int(x) for x in input().split()]
llist.sort(reverse=True)
if llist[0] < sum(llist[1:]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [long(input_raw[0])]
    input_raw = read_func().strip().split()
    L = []
    for i in range(N):
        L.append(long(input_raw[i]))

    L.sort()

    lmax = L.pop()

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

N = int(input())
L = [int(v) for v in input().split()]
lm = max(L)
sl = sum(L) - lm
if sl > lm:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

import numpy as np
L_ = np.array(L)
max_ = np.amax(L_)
true = np.sum(L_) - 2 * max_ > 0
if true:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
L.sort(reverse=True)
longest = L[0]
othersum = 0
for i in L[1:]:
    othersum = othersum + i
if othersum > longest:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ll.sort()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
L = [int(l) for l in input().split()]
mL = max(L)
L.remove(mL)
if sum(L) > mL:
    print('Yes')
else:
    print("No")

Submission status: Accepted

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

s=sum(l)
p=0
for i in l:
    if s-2*i<=0:
        p=1

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

Submission status: Accepted

Solution code:
N = int(input())
Llist = [int(_) for _ in input().split()]
max = max(Llist)
sa = sum(Llist)

ama = sa-max
if max < ama:
    print("Yes")

else:
    print("No")

Submission status: Accepted

Solution code:
N=int(input())
L=list(map(int,input().split()))
L.sort(reverse=True)
Lmax=L[0]
Lt=0
for i in range(1,N):
    Lt+=L[i]
if Lmax<Lt:
    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)
l_list.pop(l_list.index(l_max))

if l_max < sum(l_list):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
#!venv/bin/python

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

L = sorted(L)
longest = L.pop(-1)
if longest < sum(L):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

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

L_sorted = sorted(L)

L_max = L_sorted[N-1]

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

Submission status: Accepted

Solution code:
a = int(input())
b = list(map(int, input().split()))
c = 0
for i in b:
  c += i
if max(b) >= c - max(b):
  print("No")
if max(b) < c - max(b):
  print("Yes")

Submission status: Accepted

Solution code:
'''input
10
1 8 10 5 8 12 34 100 11 3
'''
import time
import math
n = int(input())
a = list(map(int, input().strip().split()))
a.sort()
u = sum(a) - a[-1]
if(a[-1] < u):
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
total = sum(L)
isOK = True

for num in L:
    if num * 2 < total:
        pass
    else:
        isOK = False

if isOK:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

l_list.sort()
l_list.reverse()

nagai=l_list[0]

gokei=sum(l_list)-nagai

if(gokei-nagai>0):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

l_max = max(L)
L.remove(l_max)

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

Submission status: Accepted

Solution code:
n = int(input())
#a,b=map(int,input().split()) #横並び
#x=[int(input()) for i in range(3)] #縦に並んだのを配列に
y=list(map(int,input().split())) #横に並んだのを配列に
#print("{:.9f}".format(a/b))
print('YNeos'[2*max(y)>=sum(y)::2])

Submission status: Accepted

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

Submission status: Accepted

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

Lmax = max(L)
Lsum = sum(L) - max(L)

if Lmax < Lsum:
    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 -*-

_ = input()

h = list(map(float, input().split()))

_max = max(h)

h.remove(_max)
s = sum(h)

r = "Yes" if s > _max else "No"
print(r)

Submission status: Accepted

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

Submission status: Accepted

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

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



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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input()
l=list(map(int,input().split()))
l.sort()
m=l.pop()
print("Yes" * (m<sum(l)) or "No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
L = sorted(list(map(int, input().split())), reverse=True)
if 2*L[0]<sum(L):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

def solve():
    N = int(input())
    L = list(map(int, input().split()))
    if sum(L) - 2*max(L) > 0:
        res =  'Yes'
    else:
        res = 'No'
    return str(res)
if __name__ == '__main__':
    print(solve())

Submission status: Accepted

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


def main():
    n = int(input())
    ls = list(map(int, input().split()))
    l_max = None
    sum_l = sum(l for l in ls)
    for l in ls:
        if l_max is None or l_max < l:
            l_max = l
    if sum_l - l_max > l_max:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
s=0
for i in l:
	s+=i
for i in l:
	if(s-i<=i):
		print("No")
		exit()
print("Yes")

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

Submission status: Accepted

Solution code:
N = int(input())

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

a = max(L) - (sum(L) - max(L))
if a < 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

L.sort()
Lmax = L.pop(-1)
Lsum = sum(L)

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

Submission status: Accepted

Solution code:
import sys

def main():
  input = sys.stdin.readline
  n = int(input())
  l = [int(a) for a in input().split()]
  m = max(l)
  s = sum(l) - m
  if s > m:
    print('Yes')
  else:
    print('No')


if __name__ == '__main__':
  main()

Submission status: Accepted

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

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

if ma < mi:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
a = list(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: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
n = int(input())
l=list(map(int, input().split()))
s=sum(l)
m=max(l)
s=s-m
if m<s:
  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:
N = int(input())
L = [int(i) for i in input().split()]
Lmax = max(L)
Lsum = sum(L)
if Lmax < Lsum - Lmax:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

edge = sorted(edge)[::-1]
max_l = edge.pop(0)

if max_l < sum(edge):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    L = list(map(int, input().split()))
    m = L.pop(L.index(max(L)))
    if sum(L) > m:
        print('Yes')
    else:
        print('No')


main()

Submission status: Accepted

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

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

Submission status: Accepted

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

ml = max(L)
sl = sum(L)-ml

if ml < sl:
	print('Yes')
else:
	print('No')

Submission status: Accepted

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

Lsum = sum(L)
Lmax = max(L)
if Lmax < Lsum - Lmax:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
l = list(map(int, input().split()))
l.sort(reverse=True)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int,input().split()))
max = 0
sum = 0
for i in range(len(L)):
    if L[i] > max:
        max = L[i]
    sum += L[i]
if max < sum-max:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

l = sorted(l)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys,collections,math;sys.setrecursionlimit(10**7)
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def Ss(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

n = I()
Ls = Is()
m = max(Ls)
if sum(Ls) - m > m:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

L.sort(reverse=True)

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque, OrderedDict
from copy import deepcopy
from functools import lru_cache, reduce
from math import ceil, floor

import heapq
import itertools
import operator


def get_int():
    return int(input())


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


def get_int_list():
    return [int(i) for i in input().split()]


def get_char_list():
    return list(input().strip())


def main():
    n = get_int()
    ls = get_int_list()
    ls.sort()
    max_ = ls.pop(-1)
    if max_ < sum(ls):
        print("Yes")
    else:
        print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

longest = L[n - 1]
l_sum = sum(L) - longest

if l_sum > longest:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
N = int(input())

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

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

Submission status: Accepted

Solution code:


import sys
import math

# -*- coding: utf-8 -*-

n = int(input())

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

a.sort()
sum = 0
for i in range(n-1):
    sum += a[i]
if sum > a[-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

L.sort()

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

Submission status: Accepted

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

Submission status: Accepted

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

li.sort()
if li[-1]*2 >= sum(li):
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
import math
import copy

def nCast(number):
    if type(number)==str:
        return int(number)
    for idx in range(0,len(number)):
        if type(number[idx])==str:

            number[idx]=int(number[idx])
        else:
            nCast(number[idx])
    return number
    
def inputArr(w):
    l=list()
    for idx in range(0,w):
        l.append(input())
    return l
def inputArr1(w):
    l=list()
    for idx in range(0,w):
        l.append(input().split())
    return l

n=nCast(input())
a=nCast(input().split())
def func():
    if sum(a)/2>max(a):
        return "Yes"
    else:
        return "No"
    
    
    
    
print(func())

Submission status: Accepted

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

Submission status: Accepted

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

sumL = sum(Ls)
maxL = max(Ls)
print('Yes' if maxL < sumL-maxL else 'No')

Submission status: Accepted

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

flg = 0
for i in range(N):
    if L[i] >= sum(L) - L[i]:
        flg = 1
        break
if flg:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

import sys  # {{{
import os
import time
import re
from pydoc import help
import string
import math
from operator import itemgetter
from collections import Counter
from collections import deque
from collections import defaultdict as dd
import fractions
from heapq import heappop, heappush, heapify
import array
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy as dcopy
import itertools
# }}}

# pre-defined{{{
sys.setrecursionlimit(10**7)
INF = 10**20
GOSA = 1.0 / 10**10
MOD = 10**9+7
ALPHABETS = [chr(i) for i in range(ord('a'), ord('z')+1)]  # can also use string module
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 DP(N, M, first): return [[first] * M for n in range(N)]
def DP3(N, M, L, first): return [[[first] * L for n in range(M)] for _ in range(N)]
from inspect import currentframe
def dump(*args):
    names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' => '+repr(arg) for arg in args), file=sys.stderr)
# }}}

def local_input():# {{{
    from pcm.utils import set_stdin
    import sys
    from pathlib import Path
    parentdir = Path(os.path.dirname(__file__)).parent
    inputfile = parentdir.joinpath('test/sample-1.in')
    if len(sys.argv) == 1:
        set_stdin(inputfile)
# }}}

def solve():
    N = int(input())
    L = list(map(int, input().split()))
    if max(L) < sum(L) - max(L):
        print("Yes")
    else:
        print("No")

    return 0

if __name__ == "__main__":# {{{
    try:
        local_input()
    except:
        pass
    solve()
# vim: set foldmethod=marker:}}}

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

L.remove(Lmax)
Lsum = sum(L)

if Lmax < Lsum:
    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 sum>l[0]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int,input().split()))
L.sort()
L_max = L.pop(-1)
if L_max < sum(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 sum(l[:-1]) > l[n-1] else "No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

lmax = max(L)

L.remove(lmax)

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

Submission status: Accepted

Solution code:
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

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

Lsum = sum(L)
Lmax = max(L)

ans = "No"
if Lmax < (Lsum-Lmax):
    ans = "Yes"
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
L = [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 = [int(x) for x in input().split()]
L.sort(reverse=True)
if(L[0]<sum(L[1:])):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8
N = int(input())
L = list(map(int,input().split())) 
L_max = max(L)
if (sum(L) / 2.0) > 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_s = sum(l)
if max_l<sum_s-max_l:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

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

if ma < su:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

print(ans)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

judge = max(L) * 2 < sum(L)

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

Submission status: Accepted

Solution code:
N=int(input())

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

L.sort()

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

Submission status: Accepted

Solution code:
N = int(input())

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

X.sort()

ma = X[N-1]
if sum(X)-X[N-1]>ma:
	print("Yes")
else:
	print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
x = list(map(int, input().split(' ')))
x.sort(reverse = True)
max = x[0]
x.remove(max)
sum = sum(x)
if max < sum:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline
n = int(input())
l_list = list(map(int, input().split()))
l_max = max(l_list)
l_other = sum(l_list) - l_max
if l_other > l_max:
    print('Yes')
else:
    print('No')