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:
# ===============================================================================================
# importing some useful libraries.
from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter  # Counter(list)  return a dict with {key: count}
from itertools import combinations as comb  # if a = [1,2,3] then print(list(comb(a,2))) -----> [(1, 2), (1, 3), (2, 3)]
from itertools import permutations as permutate
from bisect import bisect_left as bl
# If the element is already present in the list,

# the left most position where element has to be inserted is returned.
from bisect import bisect_right as br
from bisect import bisect

# If the element is already present in the list,
# the right most position where element has to be inserted is returned

# ==============================================================================================
# fast I/O region

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None


    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

# inp = lambda: sys.stdin.readline().rstrip("\r\n")

# ===============================================================================================
### START ITERATE RECURSION ###
from types import GeneratorType


def iterative(f, stack=[]):
    def wrapped_func(*args, **kwargs):
        if stack: return f(*args, **kwargs)
        to = f(*args, **kwargs)
        while True:
            if type(to) is GeneratorType:
                stack.append(to)
                to = next(to)
                continue
            stack.pop()
            if not stack: break
            to = stack[-1].send(to)
        return to

    return wrapped_func


#### END ITERATE RECURSION ####

# ===============================================================================================
# some shortcuts

mod = 1000000007


def inp(): return sys.stdin.readline().rstrip("\r\n")  # for fast input

def out(var): sys.stdout.write(str(var))  # for fast output, always take string

def lis(): return list(map(int, inp().split()))

def stringlis(): return list(map(str, inp().split()))

def sep(): return map(int, inp().split())

def strsep(): return map(str, inp().split())


def zerolist(n): return [0] * n

def nextline(): out("\n")  # as stdout.write always print sring.

def testcase(t):
    for p in range(t):
        solve()

def printlist(a):
    for p in range(0, len(a)):
        out(str(a[p]) + ' ')


def solve():
    n=int(inp())
    ar=lis()
    ar.sort()
    if 2*ar[-1]<sum(ar):
        print("Yes")
    else:
        print("No")
    
    
    
solve()

Submission status: Accepted

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

maxl = max(l)
if sum(l) - maxl > maxl:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

num = int(input())
total = 0
number = input().split(" ")
table = list(number)
x = [int(i) for i in table]
list.sort(x, reverse=True)
max = x[0]
for i in range(1, num):
    total += x[i]

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

Submission status: Accepted

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

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

if Lmax < Lsum:
    ans = "Yes"
else:
    ans = "No"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,*l=map(int,open(0).read().split())
sum_n=sum(l)
for i in range(n):
	if 2*l[i]>=sum_n:
		print('No')
		import sys
		sys.exit()
print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

saidai = max(l)
hoka = sum(l) - max(l)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
readline = stdin.buffer.readline

def main():
    N = int(readline().rstrip())
    L = list(map(int, readline().rstrip().split()))
    if max(L) < (sum(L) - max(L)):
        print('Yes')
    else:
        print('No')

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def main(n,l):
    lmax=max(l)
    if lmax*2<sum(l):
        return 'Yes'
    else:
        return 'No'

if __name__=='__main__':
    n,l=readinput()
    ans=main(n,l)
    print(ans)

Submission status: Accepted

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

s=sum(a)
if max(a)<s-max(a):
  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()))
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(map(int, input().split()))

if max(l) < sum(l) - max(l):
    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
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 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 main():
    N = I()
    L = LI()
    m = max(L)
    other = sum(L) - m
    if m < other:
        print("Yes")
    else:
        print("No")

main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
lines = [s.rstrip("\n") for s in sys.stdin.readlines()]
n, = [int(num) for num in lines.pop(0).split(" ")]
l_list = [int(num) for num in lines.pop(0).split(" ")]
l_list.sort(reverse=True)
m = l_list.pop(0)
if m < sum(l_list):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


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

    s = sum(L)
    ok = True
    for l in L:
        if l >= s - l:
            ok = False
            break

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

    return


if __name__ == '__main__':
    main()

Submission status: Accepted

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

max_L = max(L)
sum_L = sum(L)

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

Submission status: Accepted

Solution code:
n = 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:
n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = 0
for i in range(n -1):
    ans += a[i]
print("Yes" if  a[-1] < ans else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

N = int(input().rstrip())
L = [int(i) for i in input().rstrip().split()]
L.sort(reverse = True)

L = np.array(L)
x = L[0]
y = np.sum(L)-L[0]

if x<y:
  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)>0:
    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) > 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int, input().split()))
if sum(a)>2*max(a):
  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[:n-1]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

max_length = max(L)

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

Submission status: Accepted

Solution code:
N = int(input())
length = list(map(int,input().split()))
if max(length)*2 < sum(length):
  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()

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:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [input() for _ in range(n)]

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:
if __name__ == '__main__':

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

	max_n = max(A)

	if max_n < sum(A) - max_n:
		print("Yes")
	else:
		print("No")

Submission status: Accepted

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

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

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()))
m = max(l)
# 一番長い辺が他の N−1 辺の長さの合計よりも真に短い場合に限り
# 条件を満たす N 角形が描ける。
if m < sum(l)-m:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

s = sum(l)
m = max(l)

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

Submission status: Accepted

Solution code:
import sys
s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in ss]
ss2nnn = lambda ss: [s2nn(s) for s in ss]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [sys.stdin.readline().rstrip() for _ in range(n)]
ii2sss = lambda n: [list(sys.stdin.readline().rstrip()) for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))
from collections import deque  # 双方向キュー
from collections import defaultdict  # 初期化済み辞書
from heapq import heapify, heappush, heappop, heappushpop  # プライオリティキュー
from bisect import bisect_left, bisect_right  # 二分探索
sys.setrecursionlimit(int(1e+6))
MOD = int(1e+9) + 7
#import numpy as np  # 1.8.2
#import scipy  # 0.13.3

def main():
    N = i2n()
    L = i2nn()
    lsum = 0
    lmax = 0
    for l in L:
        lsum += l
        if lmax < l:
            lmax = l
    if lsum - lmax > lmax:
        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 = sorted(list(map(int, input().split())))

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

Submission status: Accepted

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

Submission status: Accepted

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

total=sum(length)
semi_total=total-long
if semi_total>long:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

print("Yes") if L[-1] < sum(L[:-1]) 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


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    n = ni()
    L = nl()
    l = max(L)
    L.remove(l)
    if l < sum(L):
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

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()))
l_max = max(l)
sum_l = sum(l) - l_max

if l_max < sum_l:
    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) < 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
l = sorted([int(x) for x in input().split()], 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)
print("Yes" if s-m>m else "No")

Submission status: Accepted

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

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

Submission status: Accepted

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

a=max(L)
sum=sum(L)

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys

def main():
    input = sys.stdin.readline
    n = int(input())
    l = list(map(int, input().split()))
    if max(l) < sum(l) - max(l):
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
L=list(map(int,input().split()))
L=sorted(L)
S=0
for i in L:
    S+=i
S-=L[N-1]
if S>L[N-1]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int,input().split()))
flg = 0
for i in range(0, n):
    if l[i] < sum(l)-l[i]:
        pass
    else:
        flg = 1
if flg == 1:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int,input().split()))
maxLength = max(L)
sumOtherLength = sum(L) - maxLength
if maxLength < sumOtherLength:
    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:
def resolve():
    input()
    L = list(map(int, input().split()))
    M = max(L)
    R = sum(L) - M
    if R > M:
        print('Yes')
    else:
        print('No')
resolve()

Submission status: Accepted

Solution code:
N = int(input())
SS = input().split()
list1 = [int(i) for i in SS]
list1.sort(reverse = True)
total = 0
maxi = list1.pop(0)
for i in list1:
  total +=i

if total > maxi :
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(N):
  L[i] = int(L[i])
  total += L[i]

for i in range(N):
  if L[i]*2 >= total:
    print("No")
    flag = 1
    break

if flag == 0:
  print("Yes")

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:
n = int(input())
l = list(map(int, input().split()))
l.sort()
print("Yes" if l[-1] < sum(l[:n-1]) else "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:
# abc117_b.py
# https://atcoder.jp/contests/abc117/tasks/abc117_b

# B - Polygon /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 200点

# 問題文
# 2次元平面上に辺の長さがそれぞれ L1,L2,...,LN の N角形(凸多角形でなくてもよい)が描けるかを判定してください。
# ここで、次の定理を利用しても構いません。

# 定理 : 一番長い辺が他の N−1辺の長さの合計よりも真に短い場合に限り、条件を満たす N角形が描ける。

# 制約
#     入力は全て整数である。
#     3≤N≤10
#     1≤Li≤100

# 入力
# 入力は以下の形式で標準入力から与えられる。
# N
# L1 L2 ... LN

# 出力
# 条件を満たす N角形が描けるなら Yes、そうでないなら No を出力せよ。

# 入力例 1
# 4
# 3 8 5 1

# 出力例 1
# Yes

# 8<9=3+5+1なので、定理より 2 次元平面上に条件を満たす N角形が描けます。

# 入力例 2
# 4
# 3 8 4 1

# 出力例 2
# No

# 8≥8=3+4+1なので、定理より 2 次元平面上に条件を満たす N角形は描けません。

# 入力例 3
# 10
# 1 8 10 5 8 12 34 100 11 3

# 出力例 3
# No


def calculation(lines):
    N = lines[0]
    # N = int(lines[0])
    values = list(map(int, lines[1].split()))
    # values = list()
    # for i in range(N):
    #     values.append(int(lines[i+1]))

    ma = max(values)
    su = sum(values)

    if ma * 2 < su:
        result = 'Yes'
    else:
        result = 'No'

    return [result]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['4', '3 8 5 1']
        lines_export = ['Yes']
    if pattern == 2:
        lines_input = ['4', '3 8 4 1']
        lines_export = ['No']
    if pattern == 3:
        lines_input = ['10', '1 8 10 5 8 12 34 100 11 3']
        lines_export = ['No']
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    if len(args) == 1:
        mode = 0
    else:
        mode = int(args[1])
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(2)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
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
s -= max(L)
if max(L) < s:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
#B
n = int(input())
l = list(map(int, input().split()))
lmax = max(l)
l.sort(reverse=True)
if lmax < sum(l[1:]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

print(['No','Yes'][sl[-1]<sum(sl[:-1])])

Submission status: Accepted

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

ls.sort(reverse=True)
max1 = ls.pop(0)
if max1 < sum(ls):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = int(input())
lst = list(map(int,input().split()))
lst.sort()

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

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    l = list(map(int, input().split()))
    l.sort(reverse=True)
    if l.pop(0) < sum(l):
        print('Yes')
    else:
        print('No')
        
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = int(input())
lst = list(map(int,input().split()))
lst.sort()

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

Submission status: Accepted

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

m = max(l)
o = sum(l) - m

if m < o:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

N = ii()
A = sorted(li())

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

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:
import math
def main():
  n = int(input())
  l = list(map(int,input().split()))
  sum=l[0]
  max=l[0]
  for i in range(1,n):
    sum+=l[i]
    if l[i]>max:
      max=l[i]
  sum-=max
  if sum>max:
    print("Yes")
  else:
    print("No")
main()

Submission status: Accepted

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

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()))
sl = sum(l)
ans = 'Yes'
for i in l:
    if sl - i*2 <= 0:
        ans = 'No'
print(ans)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

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

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

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

Submission status: Accepted

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