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: Wrong Answer

Solution code:
# B Polygon
N = int(input())
L = list(map(int, input().split()))
mx = L.pop(L.index(max(L)))
if mx > sum(L):
    print("Yes")
else:
    print("No")
pass

Submission status: Wrong Answer

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

terms = (max(l) - (sum(l) - max(l)))

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

Submission status: Wrong Answer

Solution code:
n = input()

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

print(max(l) < sum(l) - max(l))

Submission status: Wrong Answer

Solution code:
# 数値の取得
polynum = int(input())
length = list(map(int,input().split()))

# 図形の成立可否を検証し結果を出力
most_l = max(length)
othersum = sum(length) - most_l
print(most_l)
print(othersum)
if othersum > most_l:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
# ABC117

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

max_length = L[-1]
sum_length = sum(L[0:len(L)-1])

print("Yes") if max_length > sum_length else print("No")

Submission status: Wrong Answer

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

max_length = L[-1]
sum_length = sum(L[0:len(L)-1])
print(sum_length)

print("Yes") if max_length > sum_length else print("No")

Submission status: Wrong Answer

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: Wrong Answer

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: Wrong Answer

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: Wrong Answer

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

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

Submission status: Wrong Answer

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: Wrong Answer

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: Wrong Answer

Solution code:
def resolve():
    n = int(input())
    L = map(int, input().split())
    M = max(L)
    R = sum(L) - M
    if R > M:
        print('Yes')
    else:
        print('No')
resolve()

Submission status: Wrong Answer

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: Wrong Answer

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: Wrong Answer

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

l.sort()
l.reverse()
cnt = 0
for i in range(n-1):
	cnt += l[i]
if cnt > l[n-1]:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
def main():
    N = input()
    L = map(int, input().split())
    a = max(L)
    b = sum(L) - a
    if a < b:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    N = input()
    L = map(int, input().split())
    a = max(L)
    b = sum(L) - a
    if a > b:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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: Wrong Answer

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

m = max(l)
ol = list(filter(lambda x: x != m,l))
ans = "Yes" if m < sum(ol) else "No"
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

max_input=max(input_list)
Sum_input=sum(input_list)-max_input
if max_input<Sum_input:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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: Wrong Answer

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: Wrong Answer

Solution code:
def actual(n, L):
    max_l = max(L)
    others_l = sum(L) - max_l

    if max_l < others_l:
        return 'Yes'

    return 'No'

n = int(input())
L = map(int, input().split())
print(actual(n, L))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(i) for i in input().split()]
b=sorted(a)
x=sum(b[-1:])
y=sum(b[:-1])
if y<x:
	print('Yes')
else:
	print('No')

Submission status: Wrong Answer

Solution code:
number = int(input())

sides = [int(val) for val in input().split(' ')]

print(sum(sides))
print(max(sides))

Submission status: Wrong Answer

Solution code:
N=int(input())
A=sorted(map(int,input().split()))
ans=0
for i in range(N-1):
  ans+=A[i]

if ans<A[N-1]:
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

l.sort()
sum = 0
for i in range(1, n):
    sum += l[i]

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

Submission status: Wrong Answer

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

l.sort()
sum = 0
for i in range(1, n):
    sum += l[i]

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

Submission status: Wrong Answer

Solution code:

Ls = sorted(map(int, input().split()))
if Ls[-1] < sum(Ls) - Ls[-1]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
# -*- coding: <encoding name> -*-

n = int(input())
l = list(map(int, input().split()))
s = sum(l)
print('Yes' if (n - 1) > s else 'No')

Submission status: Wrong Answer

Solution code:
# -*- coding: <encoding name> -*-

n = int(input())
l = list(map(int, input().split()))
s = sum(l)
print('Yes' if (n - 1) < s else 'No')

Submission status: Wrong Answer

Solution code:
# -*- coding: <encoding name> -*-

n = int(input())
l = list(map(int, input().split()))
s = sum(l)
print('Yes' if n < s else 'No')

Submission status: Wrong Answer

Solution code:
N=int(input())
L=list(map(int,input().split()))
Lmax=L[0]
for y in range(1,N):
	if L[y-1] < L[y]:
		Lmax=L[y]
if Lmax < sum(L)-Lmax:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
n = int(input())
m = input()
m = m.split()
a = int(max(m))
l = map((lambda x: int(x)), m)
b = int(sum(l))
if a >= b - a:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
import bisect
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def Yes(): print("Yes"); return
def No(): print("No"); return

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#############
# Main Code #
#############

N = inputI()
l = inputIL()
l.sort()
if sum(l[:-1]) >= l[-1]:
  No()
else:
  Yes()

Submission status: Wrong Answer

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
import bisect
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def Yes(): print("Yes"); return
def No(): print("No"); return

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#############
# Main Code #
#############

N = inputI()
l = inputIL()
l.sort()
if sum(l[:-1]) >= sum(l):
  No()
else:
  Yes()

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
n = int(input())
l = list(map(int, input().split()))
m = sum(l)
a = 0
for i in range(n):
    if l[i] >= m - l[i]:
        print("NO")
        a = 1
        break
if a == 0:
    print("YES")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np


N = int(input())
L = list(map(int, input().split()))
maxL = np.argmax(L)
L.pop(maxL)
if maxL < sum(L):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

if max(L_list) * 2 > sum(L_list):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

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

Submission status: Wrong Answer

Solution code:
a = input()
num = map(int, input().split())
num_max = max(num)
num_sum = sum(num) - num_max
if(num_sum > num_max):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
n = int(input())
L = list(map(int,input().split()))
kekka = 0
for i in range(n):
  if 2*L[i] > sum(L):
    kekka = 1
    break
    
if kekka == 1:
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

Solution code:
n = int(input())
L = list(map(int, input().split()))
idx = L.index(max(L))
print(idx)
sum_L = 0
for i in range(len(L)):
    if i == idx:
        pass
    else:
        sum_L += L[i]

if L[idx] < sum_L:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.buffer.readline().split()]
def I(): return int(sys.stdin.buffer.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n = I()
    l = LI()
    s = sum(l)
    m = max(l)
    if 2*m > s:
        print("Yes")
    else:
        print("No")
    return

#Solve
if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

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

if max(l)*2 >sum(l):
  print("No")
  exit()
print("Yes")

Submission status: Wrong Answer

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

if max(l)*2 <=sum(l):
  print("No")
  exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
n=int(input())
l=list(map(int,input().split()))
for i in range(n):
  if l[i]*2 <=sum(l):
    print("No")
    exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
import sys
N = int(sys.stdin.readline().rstrip())
l = list(map(int, sys.stdin.readline().rstrip().split()))

lm = 0
L = 0
for n in range(N):
  if l[n] > lm:
    L += lm
    lm = l[n]
  else:
    L += l[n]
    
if lm > L:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

    return N,L

def check(N,L):
    sum =0 

    for n in range(N-1):
        sum += L[n]
    if sum > L[N-1]:
        print("YES")
    else:
        print("NO")
    



N,L =nyu()
check(N,L)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in l:
    if i > m-i:
        print ("No")
        exit ()
else:
    print ("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
List = [int(i) for i in input().split(" ")]
Max = max(List)
l = 0
for i in range(N):
    if List[i]!=Max:
        l+=List[i]

if Max<l:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
num = input()
numlist = map(int, input().split())
numlistmax = max(numlist)
totalnum = sum(numlist)
if totalnum - numlistmax > numlistmax:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(N):
    if max(L)<sum(L)-max(L):
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n=int(input())
l=list(map(int,input().split()))
l_max=max(l)
l_other=[i for i in l if i!=l_max]
if l_max<sum(l_other):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

S = sum(l)

for i in range(N):
    tmp = S - l[i]
    if tmp < l[i]:
        print("No")
        exit()
print("Yes")

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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: Wrong Answer

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: Wrong Answer

Solution code:
import sys

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
LIST = lambda: list(map(int, INPUT().split()))

sys.setrecursionlimit(10 ** 9)


def main():
    N = INT()
    L = LIST()

    one = L[0]
    others = 0
    for i in range(N-1):
        if L[i] < L[i+1]:
            one = L[i+1]
            others += L[i]
        else:
            others += L[i+1]

    print("Yes" if one < others else "No")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

max_index = l.index(max(l))

sum_length = 0

for x in range(n):
	if x == max_index:
		continue
	sum_length += l[x]

print ("YES") if sum_length > max(l) else print ("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

li.sort()

sum = 0
for i in li[:-2]:
    sum = i + sum

Nmax = li[-1]
if N <= 2 or li[0] < 1:
    print("No")
elif Nmax < sum and 0 < Nmax:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

li.sort()

sum = 0
for i in li[:-2]:
    sum = i + sum

Nmax = li[-1]
if N <= 2 or li[0] < 1:
    print("No")
elif Nmax < sum:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

li.sort()

sum = 0
for i in li[:-2]:
    sum = i + sum

Nmax = li[-1]
if N <= 2 or li[0] < 1:
    print("No")
elif Nmax >= sum:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

li.sort()

sum = 0
for i in li[:-2]:
    sum = i + sum

Nmax = li[-1]
if N <= 2:
    print("No")
elif Nmax >= sum:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

li.sort()

sum = 0
for i in li[:-2]:
    sum = i + sum

Nmax = li[-1]
if N <= 2:
    Print("No")
elif Nmax >= sum:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

li.sort()

sum = 0
for i in li[:-2]:
    sum = i + sum

Nmax = li[-1]
if Nmax >= sum:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n=int(input())
line=list(map(int,input().split()))
border=sum(line)/2

flag=True
for i in line:
  if i >= border:
    flag=False
    break

if flag:
  print('yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
N = int(input())
L = list(map(int, input().split()))
lmax = max(L)
suml = 0
for i in L:
    if i != lmax:
        suml += i

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

Submission status: Wrong Answer

Solution code:
N = int(input())
L = list(map(int, input().split()))
lmax = max(L)
suml = 0
for i in L:
    if i != lmax:
        suml += i

if lmax < suml:
    print('Yes')
    exit()
print('No')

Submission status: Wrong Answer

Solution code:
"""
author : halo2halo
date : 16, Jan, 2020
"""

import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N = int(readline())
L = list(map(int, readline().split()))
S = sum(L)
ans = True
for i in L:
    if S >= i+i:
        ans = False
        break

print('Yes' if ans else 'No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
input_angle = int(input())
input_length = input()

_length = input_length.split(' ')
length = [int(l) for l in _length]
length.sort()
sum = 0

for i in range(input_angle-2):
  sum += int(length[i])
  
if int(length[-1]) < sum:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
input_angle = int(input())
input_length = input()

length = input_length.split(' ')
length.sort()
sum = 0

for i in range(input_angle-1):
  sum += int(length[i])
  
if sum >= int(length[-1]):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
input_angle = int(input())
input_length = input()

length = input_length.split(' ')
length.sort()
sum = 0

for i in range(input_angle-1):
  sum += int(length[i])
  
if sum > int(length[-1]):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

L_i = [int(s) for s in L]

Length = 0
sum = 0
num = 0

for i in range(N):
    sum += L_i[i]
    
    if L_i[i] > Length:
        Length = L_i[i]
        num = i


if Length * 2 < sum:
    print("yes")
else:
    print("no")

Submission status: Wrong Answer

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

L_i = [int(s) for s in L]

Length = 0
sum = 0
num = 0

for i in range(N):
    sum += L_i[i]
    
    if L_i[i] > Length:
        Length = L_i[i]
        num = i


if Length * 2 > sum:
    print("yes")
else:
    print("no")

Submission status: Wrong Answer

Solution code:
N = input()
l = map(int,input().split())
maxi = max(l)
if sum(l)-maxi > maxi:
    print("Yes")
else:
    print("No")