TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Find the largest integer that can be formed with exactly N matchsticks, under the following conditions:    * Every digit in the integer must be one of the digits A_1, A_2, ..., A_M (1 \leq A_i \leq 9).   * The number of matchsticks used to form digits 1, 2, 3, 4, 5, 6, 7, 8, 9 should be 2, 5, 5, 4, 5, 6, 3, 7, 6, respectively.

Submission attempts (in order):



def solve():
	
	num = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
	N, M = map(int, input().split())
	A = [int(i) for i in input().split()]
	A.sort(reverse=True)
	
	
	dp = [-1 * float("inf")] * (N + 1)

	
	dp[0] = 0
	for n in range(1, N + 1):
		for a in A:
			if n - num[a] >= 0:
				
				
				
				dp[n] = max(dp[n], dp[n - num[a]] + 1)
	print('各本数丁度で作れる最大桁数')
	print(dp)

	
	ans = ''
	for i in range(dp[N]):  
		for a in A:
			
			
			
			
			
			
			
			
			if N - num[a] > -1 and dp[N] - 1 == dp[N - num[a]]:
				ans += str(a)
				N -= num[a]
				break
		

	print(ans)


if __name__ == '__main__':
	solve()





def solve():
	
	num = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
	N, M = map(int, input().split())
	A = [int(i) for i in input().split()]
	A.sort(reverse=True)
	
	
	dp = [-1 * float("inf")] * (N + 1)

	
	dp[0] = 0
	for n in range(1, N + 1):
		for a in A:
			if n - num[a] >= 0:
				
				
				
				dp[n] = max(dp[n], dp[n - num[a]] + 1)

	
	ans = ''
	for i in range(dp[N]):  
		for a in A:
			
			
			
			
			
			
			
			
			if N - num[a] > -1 and dp[N] - 1 == dp[N - num[a]]:
				ans += str(a)
				N -= num[a]
				break
		

	print(ans)


if __name__ == '__main__':
	solve()


Verdicts: Wrong Answer

Accepted
Problem: Find the largest integer that can be formed with exactly N matchsticks, under the following conditions:    * Every digit in the integer must be one of the digits A_1, A_2, ..., A_M (1 \leq A_i \leq 9).   * The number of matchsticks used to form digits 1, 2, 3, 4, 5, 6, 7, 8, 9 should be 2, 5, 5, 4, 5, 6, 3, 7, 6, respectively.

Submission attempts (in order):
l = list(map(int, input().split(' ')))
d = {}  # key=match, val=num
d[2] = [1]
d[3] = [7]
d[4] = [4]
d[5] = [5, 3, 2]
d[6] = [9, 6]
d[7] = [8]
enable = [False] * 10
for a in l:
  enable[a] = True
memo = {}

def f(nokori, current):
  k = (nokori, current)
  if k in memo:
    return memo[k]
  if nokori <= 0:
    return current if nokori == 0 else -1
  temps = []
  for key, nums in list(d.items())[::-1]:
    for num in nums:
      if enable[num]:
        temps.append(f(nokori-key, current*10+num))
        break
  memo[k] = max(temps)
  return memo[k]
 

hoge = False
for key, nums in list(d.items()):
    for num in nums:
      if enable[num]:
        hoge = True
        break
    if hoge:
      break
cs = []
while n > 50:
  n -= key
  cs.append(str(num))


ans = str(f(n, 0))
print(''.join(sorted(list(ans) + cs)[::-1]))

n, m = list(map(int, input().split(' ')))
l = list(map(int, input().split(' ')))
d = {}  # key=match, val=num
d[2] = [1]
d[3] = [7]
d[4] = [4]
d[5] = [5, 3, 2]
d[6] = [9, 6]
d[7] = [8]
enable = [False] * 10
for a in l:
  enable[a] = True

def f(nokori, current):
  if nokori == 0:
    return current
  if nokori < 0:
    return -1
  temps = []
  for key, nums in list(d.items())[::-1]:
    for num in nums:
      if enable[num]:
        if nokori-key != 0 and current % 10 != 0 and current % 10 < num:
          
          continue
        temps.append(f(nokori-key, current*10+num))
        break
  return max(temps)


def hoge():
  for key, nums in list(d.items()):
      for num in nums:
        if enable[num]:
          return (num, key)
num, key = hoge()
cs = []
while n > 50:
  n -= key
  cs.append(str(num))


num_ans = str(f(n, 0))
print(''.join(sorted(list(num_ans) + cs)[::-1]))


Verdicts: Runtime Error

Accepted
Problem: Find the largest integer that can be formed with exactly N matchsticks, under the following conditions:    * Every digit in the integer must be one of the digits A_1, A_2, ..., A_M (1 \leq A_i \leq 9).   * The number of matchsticks used to form digits 1, 2, 3, 4, 5, 6, 7, 8, 9 should be 2, 5, 5, 4, 5, 6, 3, 7, 6, respectively.

Submission attempts (in order):
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)

table = {1: 2, 2: 5, 3: 5, 4: 4, 5: 5, 6: 6, 7: 3, 8: 7, 9: 6}
a = [table[i] for i in A]


INF = float('inf')
dp = [-INF] * (N + 1)
dp[0] = 0
cost = set(a)

for i in range(1, N + 1):
    for j in cost:
        if i - j >= 0 and dp[i] < dp[i - j] + 1:
            dp[i] = dp[i - j] + 1

answer = []
for i in A:
    x = table[i]
    if N - x >= 0 and dp[N] == dp[N - x] + 1:
        answer.append(i)
        N -= x

print(''.join(map(str, answer)))

N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)

table = {1: 2, 2: 5, 3: 5, 4: 4, 5: 5, 6: 6, 7: 3, 8: 7, 9: 6}
a = [table[i] for i in A]


INF = float('inf')
dp = [-INF] * (N + 1)
dp[0] = 0
cost = set(a)

for i in range(1, N + 1):
    for j in cost:
        if i - j >= 0 and dp[i] < dp[i - j] + 1:
            dp[i] = dp[i - j] + 1

answer = []
for i in A:
    x = table[i]
    while N - x >= 0 and dp[N] == dp[N - x] + 1:
        answer.append(i)
        N -= x

print(''.join(map(str, answer)))

Verdicts: Wrong Answer

Accepted
Problem: Find the largest integer that can be formed with exactly N matchsticks, under the following conditions:    * Every digit in the integer must be one of the digits A_1, A_2, ..., A_M (1 \leq A_i \leq 9).   * The number of matchsticks used to form digits 1, 2, 3, 4, 5, 6, 7, 8, 9 should be 2, 5, 5, 4, 5, 6, 3, 7, 6, respectively.

Submission attempts (in order):



def solve():
    
    num = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
    N, M = map(int, input().split())
    A = [int(i) for i in input().split()]
    A.sort(reverse=True)
    
    
    dp = [-1 * float("inf")] * (N + 1)

    
    for n in range(1, N + 1):
        for a in A:
            if n - num[a] >= 0:
                
                
                
                dp[n] = max(dp[n], dp[n - num[a]] + 1)
    
    # print(dp)

    
    ans = ''
    for i in range(dp[N]):  
        for a in A:
            
            
            
            
            
            
            
            
            if N - num[a] > -1 and dp[N] - 1 == dp[N - num[a]]:
                ans += str(a)
                N -= num[a]
                break
        

    print(ans)


if __name__ == '__main__':
    solve()





def solve():
    
    num = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
    N, M = map(int, input().split())
    A = [int(i) for i in input().split()]
    A.sort(reverse=True)
    
    
    dp = [-1 * float("inf")] * (N + 1)

    
    dp[0] = 0
    for n in range(1, N + 1):
        for a in A:
            if n - num[a] >= 0:
                
                
                
                dp[n] = max(dp[n], dp[n - num[a]] + 1)
    
    # print(dp)

    
    ans = ''
    for i in range(dp[N]):  
        for a in A:
            
            
            
            
            
            
            
            
            if N - num[a] > -1 and dp[N] - 1 == dp[N - num[a]]:
                ans += str(a)
                N -= num[a]
                break
        

    print(ans)


if __name__ == '__main__':
    solve()


Verdicts: Runtime Error

Accepted
Problem: Find the largest integer that can be formed with exactly N matchsticks, under the following conditions:    * Every digit in the integer must be one of the digits A_1, A_2, ..., A_M (1 \leq A_i \leq 9).   * The number of matchsticks used to form digits 1, 2, 3, 4, 5, 6, 7, 8, 9 should be 2, 5, 5, 4, 5, 6, 3, 7, 6, respectively.

Submission attempts (in order):
n_dic = {1:2,2:5,3:5,4:4,5:5,6:6,7:3,8:7,9:6}
n,m = map(int,input().split())
l = list(map(int,input().split()))
dic = {}
for i in l:
    if n_dic[i] not in dic or dic[n_dic[i]] < i:
        dic[n_dic[i]] = i
if n % min(dic) == 0:
    ans = str(dic[min(dic)]) * int(n / min(dic))
else:
    ans = str(dic[min(dic)]) * int(n / min(dic))
    sub = n - min(dic) * int(n / min(dic))
    ind = 0
    while sub > 0 and ind < len(ans):
        dif = 0
        v = int(ans[ind])
        for i in range(min(dic) + 1,min(dic) + sub + 1):
            if i in dic and int(dic[i]) > v:
                v = dic[i]
                dif = i - min(dic)
        sub -= dif
        ans = ans[:ind] + str(v) + ans[ind+1:]
        ind += 1
print(ans)

n,m = map(int, input().split())
a = [int(a) for a in input().split()]
l = [0,2,5,5,4,5,6,3,7,6]
a.sort(reverse=True)
dp = [0]+[-1]*n
for i in range(1,n+1):
    for j in a:
        if l[j] <= i:
            dp[i] = max(dp[i], dp[i-l[j]]*10+j)
print(dp[-1])

Verdicts: Wrong Answer

Accepted
Problem: Find the largest integer that can be formed with exactly N matchsticks, under the following conditions:    * Every digit in the integer must be one of the digits A_1, A_2, ..., A_M (1 \leq A_i \leq 9).   * The number of matchsticks used to form digits 1, 2, 3, 4, 5, 6, 7, 8, 9 should be 2, 5, 5, 4, 5, 6, 3, 7, 6, respectively.

Submission attempts (in order):
N,M=map(int,input().split())
num={1:2,2:5,3:5,4:4,5:5,6:6,7:3,8:7,9:6}
A=list(map(int,input().split()))
A.sort(reverse = True)
dp = [0]+[-1]*(N+1)
for i in range(N):
    for j in A:
        if i+num[j]<=N:
            dp[i+num[j]] = max(dp[i+num[j]],dp[i]+1)
ans = []
m=N
while m>0:
    for i in A:
        if m-num[i]>=0 and dp[m-num[i]==dp[m]-1:
            m-=num[i]
            ans.append(str(i))
            break
print("".join(ans))

N,M=map(int,input().split())
A=list(map(int,input().split()))
A.sort(reverse=True)
numk={1:2,2:5,3:5,4:4,5:5,6:6,7:3,8:7,9:6}
dp=[0]+[-float('inf')]*(N)
for i in range(N):
  for j in A:
    if i+numk[j]<=N:
      dp[i+numk[j]]=max(dp[i+numk[j]],dp[i]+1)
m=N
ans=[]
while m>0:
  for i in range(M):
    if dp[m-numk[A[i]]]+1==dp[m]:
      ans.append(A[i])
      m-=numk[A[i]]
ans.sort(reverse=True)
for i in range(len(ans)):
  ans[i]=str(ans[i])
a=''.join(ans)
print(a)

N,M=map(int,input().split())
A=list(map(int,input().split()))
A.sort(reverse=True)
numk={1:2,2:5,3:5,4:4,5:5,6:6,7:3,8:7,9:6}
dp=[0]+[-1]*(N+1)
for i in range(N):
    for j in A:
        if i+numk[j]<=N:
            dp[i+numk[j]]=max(dp[i+numk[j]],dp[i]+1)
m=N
ans=[]
while m>0:
    for i in A:
        if m-numk[i]>=0 and dp[m-numk[i]]+1==dp[m]:
            ans.append(str(i))
            m-=numk[i]
            break
print(''.join(ans))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Find the largest integer that can be formed with exactly N matchsticks, under the following conditions:    * Every digit in the integer must be one of the digits A_1, A_2, ..., A_M (1 \leq A_i \leq 9).   * The number of matchsticks used to form digits 1, 2, 3, 4, 5, 6, 7, 8, 9 should be 2, 5, 5, 4, 5, 6, 3, 7, 6, respectively.

Submission attempts (in order):
n,m=map(int,input().split())
x=[2,5,5,4,5,6,3,7,6]
a=[]
for i in map(int,input().split()):
    a.append([i,x[i-1]])
mi=a[0]
for i in range(1,m):
    if mi[1]>a[i][1] or (mi[1]==a[i][1] and a[i][0]>mi[0]):
        mi=a[i]
a=[a[i] for i in range(m) if a[i][0]>=mi[0]]
m=len(a)
b=sorted(a,key=lambda x:x[1])
c=sorted(a,reverse=True)
d1=n//mi[1]
ans=[mi[0]]*d1
d2=n%mi[1]
now=0
for i in range(m-1):
    y=d2//(c[i][1]-mi[1])
    if y!=0:
        for j in range(now,now+y):
            ans[j]=c[i][0]
        now+=y
        d2-=(c[i][1]-mi[1])*y
    if d2==0:
        break
print(ans)

n,m=map(int,input().split())
x=[2,5,5,4,5,6,3,7,6]
a=[]
for i in map(int,input().split()):
    a.append([i,x[i-1]])
mi=a[0]
for i in range(1,m):
    if mi[1]>a[i][1] or (mi[1]==a[i][1] and a[i][0]>mi[0]):
        mi=a[i]
a=[a[i] for i in range(m) if a[i][0]>=mi[0]]
m=len(a)
b=sorted(a,key=lambda x:x[1])
c=sorted(a,reverse=True)
d1=n//mi[1]
ans=[mi[0]]*d1
d2=n%mi[1]
now=0
for i in range(m-1):
    y=d2//(c[i][1]-mi[1])
    if y!=0:
        for j in range(now,now+y):
            ans[j]=c[i][0]
        now+=y
        d2-=(c[i][1]-mi[1])*y
    if d2==0:
        break
cnt=0
for i in range(d1):
    cnt=cnt*10+ans[i]
print(cnt)

n,m=map(int,input().split())
x=[2,5,5,4,5,6,3,7,6]
a=[]
for i in map(int,input().split()):
    a.append([i,x[i-1]])
a.sort(reverse=True)
dp=[0]*(n+1)
for i in range(m):
    for j in range(n+1):
        if j==0 or dp[j]!=0:
            if j+a[i][1]<=n:
                dp[j+a[i][1]]=max(dp[j+a[i][1]],dp[j]*10+a[i][0])
print(dp[n])

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Find the largest integer that can be formed with exactly N matchsticks, under the following conditions:    * Every digit in the integer must be one of the digits A_1, A_2, ..., A_M (1 \leq A_i \leq 9).   * The number of matchsticks used to form digits 1, 2, 3, 4, 5, 6, 7, 8, 9 should be 2, 5, 5, 4, 5, 6, 3, 7, 6, respectively.

Submission attempts (in order):
n,m,*a=map(int,open(0).read().split())
d=[0]*n+[-1]*9
for i in range(n+1):d[i]=max(d[i-int("0255456376"[j])]*10+j for j in a)
print(d[n])

n,m,*a=map(int,open(0).read().split());d=[0]*n+[-1]*9
for i in range(n):d[i+1]=max(d[i-int("0144345265"[j])]*10+j for j in a)
print(d[n])

Verdicts: Wrong Answer

Accepted
Problem: In order to pass the entrance examination tomorrow, Taro has to study for T more hours.  Fortunately, he can _leap_ to World B where time passes X times as fast as it does in our world (World A).  While (X \times t) hours pass in World B, t hours pass in World A.  How many hours will pass in World A while Taro studies for T hours in World B?

Submission attempts (in order):
a,b = int(input())
print("%.10f"%(a/b))

a,b = map(int,input().split())
print("%.10f"%(a/b))

Verdicts: Runtime Error

Accepted
Problem: In order to pass the entrance examination tomorrow, Taro has to study for T more hours.  Fortunately, he can _leap_ to World B where time passes X times as fast as it does in our world (World A).  While (X \times t) hours pass in World B, t hours pass in World A.  How many hours will pass in World A while Taro studies for T hours in World B?

Submission attempts (in order):
all=input().split()
T=all[0]
X=all[1]
round(T/X,10)

all=input().split()
T=int(all[0])
X=int(all[1])
round(T/X,10)

all=input().split();T=int(all[0]);X=int(all[1]);print(str(round(T/X,10)))

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: In order to pass the entrance examination tomorrow, Taro has to study for T more hours.  Fortunately, he can _leap_ to World B where time passes X times as fast as it does in our world (World A).  While (X \times t) hours pass in World B, t hours pass in World A.  How many hours will pass in World A while Taro studies for T hours in World B?

Submission attempts (in order):
a,b = (int(x) for x in input.split())
 
print(round((a/b),10))

a,b = [int(x) for x in input.split()]

print(round((a/b),10))

a,b = [int(x) for x in input().split()]
 
print(round((a/b),10))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: In order to pass the entrance examination tomorrow, Taro has to study for T more hours.  Fortunately, he can _leap_ to World B where time passes X times as fast as it does in our world (World A).  While (X \times t) hours pass in World B, t hours pass in World A.  How many hours will pass in World A while Taro studies for T hours in World B?

Submission attempts (in order):
N, M = map(int,input().split())
a = list(map(int, input().split()))
a.sort()
#print(a)
if N > M:
    ans = 0
else:
    distance = [abs(a[i+1] - a[i]) for i in range(M-1)]
    #print(distance)
    distance.sort()
    #print(distance)
    del distance[M-N:]
    ans = 0 
    for j in distance:
        ans += j
print(ans)

T,x = map(int, input().split())
print(T,x)
t = T/x
print(round(t,10))

T,x = map(int, input().split())
#print(T,x)
t = T/x
print(round(t,10))


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: In order to pass the entrance examination tomorrow, Taro has to study for T more hours.  Fortunately, he can _leap_ to World B where time passes X times as fast as it does in our world (World A).  While (X \times t) hours pass in World B, t hours pass in World A.  How many hours will pass in World A while Taro studies for T hours in World B?

Submission attempts (in order):
    # -*- coding: utf-8 -*-
    import sys
    # ----------------------------------------------------------------
    # Use Solve Function
     
    def solve(lines):
        T,X = map(float, lines.pop(0).split(' '))
        print('{:.10f}'.format(T/X))
    #
    # main
    #
     
    # 1. use list instead of stdin
     
    # contents = '''\
    # 99 1\
    # '''
    
     
    # 2. use stdin
     
    lines = [x.strip() for x in sys.stdin.readlines()]
     
    #
    # solve !!
    #
    solve(lines)

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

def solve(lines):
    T,X = map(float, lines.pop(0).split(' '))
    print('{:.10f}'.format(T/X))
#
# main
#

# 1. use list instead of stdin

# contents = '''\
# 99 1\
# '''


# 2. use stdin

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

#
# solve !!
#
solve(lines)

Verdicts: Runtime Error

Accepted
Problem: In order to pass the entrance examination tomorrow, Taro has to study for T more hours.  Fortunately, he can _leap_ to World B where time passes X times as fast as it does in our world (World A).  While (X \times t) hours pass in World B, t hours pass in World A.  How many hours will pass in World A while Taro studies for T hours in World B?

Submission attempts (in order):
x=input().slice()
a=int(x[0])
b=int(x[1])
result=float(a/b)
result=round(result,10)
print(result)

x=input().split()
a=int(x[0])
b=int(x[1])
result=float(a/b)
result=round(result,10)
print(result)


Verdicts: Runtime Error

Accepted
Problem: In order to pass the entrance examination tomorrow, Taro has to study for T more hours.  Fortunately, he can _leap_ to World B where time passes X times as fast as it does in our world (World A).  While (X \times t) hours pass in World B, t hours pass in World A.  How many hours will pass in World A while Taro studies for T hours in World B?

Submission attempts (in order):
N, M = map(int, input().split( ))
datas = list(map(int, input().split( )))
datas.sort()
Ms = M - 1

dest = list()
K = 0
i = 0
for i in range(Ms):
  K = datas[i+1] - datas[i]
  dest.append(K)

dest.sort()
L = 0
MN = M - N
for j in range(MN):
  L = L + dest[j]

print(L)


N, M = map(int, input().split( ))
datas = list(map(int, input().split( )))
datas.sort()
Ms = M - 1

dest = list()
K = 0
i = 0
for i in range(Ms):
  K = datas[i+1] - datas[i]
  dest.append(K)
  dest.sort()

L = 0
MN = M - N

for j in range(MN):
  L = L + dest[j]

print(L)

N, M = map(int, input().split( ))
#print(N)
#print(M)
datas = list(map(int, input().split( )))

datas.sort()

Ms = M - 1

dest = list()
K = 0
i = 0
for i in range(Ms):
  K = datas[i+1] - datas[i]
  dest.append(K)
  dest.sort()
  

#print(dest)
L = 0
MN = M - N
for j in range(MN):
  L = L + dest[j]

print(L)

a, b = map(int, input().split( ))
k = round((a / b), 10)
print("{0:.10f}".format(k))

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: In order to pass the entrance examination tomorrow, Taro has to study for T more hours.  Fortunately, he can _leap_ to World B where time passes X times as fast as it does in our world (World A).  While (X \times t) hours pass in World B, t hours pass in World A.  How many hours will pass in World A while Taro studies for T hours in World B?

Submission attempts (in order):
T,X=map(int,input().split())

if __name__ == '__main__':
    value = (T/X)
    roundValue = round(value, 10)
    print('Round = ' + str(roundValue))


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

num = (T/X)
print("{:.10f}".format(num))

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a= input()
b = input().split()
s = 0
for i in range(0,len(b)):
    s+=int(b[i])
if s-max(b)>max(b):
    print("Yes")
else:
    print("No")

a= input()
b = input().split()
b = [int(s) for s in b]
s = 0
for i in range(0,len(b)):
    s+=int(b[i])
print(s)
if s-int(max(b))>int(max(b)):
    print("Yes")
else:
    print("No")

a= input()
b = input().split()
s = 0
for i in range(0,len(b)):
               s+=int(b[i])
if s-max(b)>max(b):
  print("Yes")
else:
  print("No)

a= input()
b = input().split()
b = [int(s) for s in b]
s = 0
for i in range(0,len(b)):
    s+=int(b[i])
if s-int(max(b))>int(max(b)):
    print("Yes")
else:
    print("No")

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N=int(input())
l=list(map(int,input().split()))
l=sorted(l)

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


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

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


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
max=0
sum=0
for i in range(n):
  a=int(input())
  if a>=max:
    max=a
  sum=sum+a
if sum-a<a:
  print("Yes")
else:
  print("No")


n=int(input())
m=0
s=0
a=list(map(int,input().split()))
for i in range(n):
  if a[i] >= m:
    m=a[i]
  s=s+a[i]
if s-m>m:
  print("Yes")
else:
  print("No")
    

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
l=list(map(int,input().split()))
print('YNeos'[sum(l)>=max(l)::2])

n=int(input())
l=list(map(int,input().split()))
print('YNeos'[sum(l)-max(l)<=max(l)::2])

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
array=[]
for i in range(n):
  k=int(input())
  array.append(k)
array.sorted()
sum=0
for i in range(n-1):
  sum+=array[i]
if array[n-1]<sum:
  print('Yes')
else:
  print('No')

n=int(input())
array=[]
for i in range(n):
  k=int(input())
  array.append(k)
array.sort()
sum=0
for i in range(n-1):
  sum+=array[i]
if array[n-1]<sum:
  print('Yes')
else:
  print('No')

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

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

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

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

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
L = list(map(int, input().split()))

L.sort
if sum(L[:-1]) > L[-1]
    ans = "Yes"
else: ans = "No"

print(ans)

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

L.sort()

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

print(ans)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
# -*- coding: utf-8 -*-
N = int(input())
L = list(map(int, inpout().split()))
if max(L) > (sum(L)-max(L)):
    print("Yes")
else:
    print("No")

# -*- coding: utf-8 -*-
N = int(input())
L = list(map(int, input().split()))
if max(L) < (sum(L)-max(L)):
    print("Yes")
else:
    print("No")

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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")

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

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

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

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
A = [int(n) for n in input().split()]
maxA = max(A)
if maxA < sum(A) - maxA:
 print("yes")
else:
 print("no")

N = int(input())
L = [int(n) for n in input().split()]
maxL = max(L)
if maxL < sum(L) - maxL
	print("yes")
else:
	print("no")

N = int(input())
A = [int(n) for n in input().split()]
maxA = max(A)
if maxA < sum(A) - maxA:
	print("yes")
else:
	print("no")

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

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: 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.

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

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

Verdicts: Runtime Error

Accepted
Problem: 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.

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

N = int(input())
L = list(map(int, input(.split())))
ind = L.index(max(L))
if sum(L[ind-1:])+sum(L[:ind+1]) < max(L)
    print('Yes')
else:      
    print('No')

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

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

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

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

n = int(input())
l = list(map(int , [input() for i in range(n)]))
l_max = max(l)
if (sum(l) - l_max) > 0:
  print('Yes')
else :
  print('No')


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

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

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a = int(input())
l = list(map(int,input().split()))
max = max(l)
sum = sum(l)
if max < (sum -max) :
  print("yes")
else :
  print("no")

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
l=list(map(int,imput().split()))
lmax=max(l)
if lmax<sum(l)-lmax:
	print('Yes')
else:
	print('No')

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
l = list(map(int,input(),split()))

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

N = input()
L = map(int,raw_input().split())
if max(L) >= (sum(L)-max(L)):
  print "No"
else:
  print "Yes"

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

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

N = int(input())
l = list(map(int, input().split()))
if 2 * max(l) < sum(l):
  print("Yes")
else:
  print("No")


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
# 117b

def atc_117b(N: int, Li_input: str) -> str:
    Li = [int(i) for i in Li_input.split(" ")]
    Li = sorted(Li)
    max_length = Li.pop()
    if max_length < sum(Li):
        return "Yes"
    return "No"

N_input_value = int(input())
Li_input_Value = input()
print(atc_117b(N_input_value, Li_input_value))


# 117b

def atc_117b(N: int, Li_input: str) -> str:
    Li = [int(i) for i in Li_input.split(" ")]
    Li = sorted(Li)
    max_length = Li.pop()
    if max_length < sum(Li):
        return "Yes"
    return "No"

N_input_value = int(input())
Li_input_value = input()
print(atc_117b(N_input_value, Li_input_value))


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n, *l = map(int, open(0).read().split())

max = 0
total = 0
for i in range(0, n):
    if l[i] > max:
        total += max
        max = l[i]
    else:
        total += l[i]

if max >= total:
    print('NO')
else:
    print('YES')

n, *l = map(int, open(0).read().split())

max = 0
total = 0
for i in range(0, n):
    if l[i] > max:
        total += max
        max = l[i]
    else:
        total += l[i]

if max >= total:
    print('No')
else:
    print('Yes')

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
Lli = input().split()
L = [int(i) for i in Lli]
sL = sorted(L)
if sum(sL[:-1]) < sL[-1]:
    print('Yes')
else:
    print('No')

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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
s = [int(i) for i in intpu().split()]

s = sorted(s, reverse=True)
print("Yes" if s[0] < sum(s[1:]) else "No")

n = int(input())
x = [int(i) for i in input().split()]
x = sorted(x, reverse=True)
print("Yes" if x[0] < sum(x[1:]) else "No")

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = input()
a = [input() for i in range(N)]

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

N = int(input())
a = [input() for i in range(N)]
if max(a)　>=　sum(a) - max(a):
  print("Yes")
else:
  print("No")

N = input()
a = [input() for i in range(N)]

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

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

N = input()
a = [input() for i in range(N)]

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

N = input()
a = [input() for i in range(N)]

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

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

n = input()
N = int(n)
a = [input() for i in range(N)]
a = int(a)
if max(a)　>=　sum(a) - max(a):
  print("Yes")
else:
  print("No")

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

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

N = int(input())
a = int([input() for i in range(N)])
if max(a)　>=　sum(a) - max(a):
  print("Yes")
else:
  print("No")

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
l=input().split()
for i in range(n):
    l[i] = int(l[i])

l.sort()
max = l.pop(-1)
sum = sum(l)
if sum>max:
    print("YES")
else:
    print("NO")

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

l.sort()
max = l.pop(-1)
sum = sum(l)
if sum>max:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
l = [int(x) for x in input().split()]
sumSides = sum(l)
longestSide = max(l)
if (longestSide < sumSides - longestSide):
  print("YES")
else:
  print("NO")

n = int(input())
l = [int(x) for x in input().split()]
sumSides = sum(l)
longestSide = max(l)
if (longestSide < sumSides - longestSide):
  print("Yes")
else:
  print("No")

Verdicts: Wrong Answer

Accepted
Problem: 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.

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

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
l = list(map(int, input().split()))

l.sort()
print(l[-1], sum(l[:-1]))
if l[-1] >= sum(l[:-1]):
    print('No')
else:
    print('Yes')


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

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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
# l = sort(map(int, input().split()))
l = sort(int(x) for x in input().split())
l_sum = 0
for i in range(n-1):
	l_sum += l[i]
if l_sum > l[n-1]:
	print('Yes')
else:
	print('No')

n = int(input())
# l = sort(map(int, input().split()))
l = (int(x) for x in input().split()).sort()
l_sum = 0
for i in range(n-1):
	l_sum += l[i]
if l_sum > l[n-1]:
	print('Yes')
else:
	print('No')

n = int(input())
l = sort(map(int, input().split()))
l_sum = 0
for i in range(n-1):
	l_sum += l[i]
if l_sum > l[n-1]:
	print('Yes')
else:
	print('No')

n = int(input())
l = [int(x) for x in input().split()]
l.sort()
# print(l)
l_sum = 0
for i in range(n-1):
	l_sum += l[i]
if l[n-1] < l_sum:
	print('Yes')
else:
	print('No')

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
ll = list(sorted(map(int, input().split())))

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

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

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
l = list(map(int,input().split()))w
if max(l) >= sum(l)-max(l):
  print('No')
else:
  print('Yes')

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
ls = list(map(int, input().split(" ")))
print("Yes" if 2*max(ls) > sum(ls) else "No")

n = int(input())
ls = list(map(int, input().split(" ")))
print("Yes" if 2*max(ls) < sum(ls) else "No")


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
l = map(int,input().split())
if sum(l) > 2*max(l):
    print("Yes")
else:
    print("No")

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n=input()
int(n)
all=0
a=[]
a=input().split()
mx=0
for i in range(0,n):
	x=int(a[i])
	if x>mx: mx=x
	all=all+x
if all>2*mx : print("Yes")
else : print("No")

n=int(input())
l=list(map(int,input().split()))
m=max(l)
del l[l.index(m)]
s=sum(l)
if s<=m:
    print('No')
else:
    print('Yes')
























Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
_ = input()
cand_list = list(map(int, input().split()))
max_val = max(cand_list)
print('Yes' if len([i for i in cand_list if i < max_val])==len(cand_list) else 'No')

_ = input()
cand_list = list(map(int, input().split()))
max_val = max(cand_list)
print('Yes' if sum(cand_list) > 2*max_val else 'No')


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = input()
L = list(input().split())
b=0
L.sort()
 
a = L.pop(-1)
 
for i in range(N-1):
  b+= L[i]
 
if (a < b):
  print("Yes")
else:
  print("No")

N = input()
L = list(input().split())
b=0
L.sort()
 
a = L.pop(-1)
 
for i in range(N-1):
  b += L[i]
 
if (a < b):
  print("Yes")
else:
  print("No")

N = input()
L = input().split()
b=0
L.sort()

a = L.pop(-1)

for i in range(N-1):
  b+= L[i]

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



N = int(input())
L = list(map(int, input().split()))
b=0
L.sort()
 
a = L.pop(-1)
 
for i in range(N-1):
  b+= L[i]
 
if (a < b):
  print("Yes")
else:
  print("No")

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
L = list(map(int,input().split()))
L.sort()
if L[-1] < sum(L[0:-1]):
    print('YES')
else:
    print('NO')

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):

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



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

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


Verdicts: Wrong Answer

Accepted