TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball.  Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i.  Find the number of boxes that may contain the red ball after all operations are performed.

Submission attempts (in order):
n,m=map(int,input().split())
print(n,m)

li=[1]*(n+1)

se=set()
se.add(1)
for  i in range(m):
	x,y=map(int,input().split())
	li[x]-=1
	li[y]+=1
	print(li)
	if x in se:
		se.add(y)
	if li[x]==0:
		se.remove(x)
print(len(se))

n,m=map(int,input().split())

li=[1]*(n+1)

se=set()
se.add(1)
for  i in range(m):
	x,y=map(int,input().split())
	li[x]-=1
	li[y]+=1
	print(li)
	if x in se:
		se.add(y)
		if li[x]==0:
			se.remove(x)
print(len(se))

n,m=map(int,input().split())

li=[1]*(n+1)

se=set()
se.add(1)
for  i in range(m):
	x,y=map(int,input().split())
	li[x]-=1
	li[y]+=1
	print(li)
	if x in se:
		se.add(y)
	if li[x]==0:
		se.remove(x)
print(len(se))

n,m=map(int,input().split())

li=[1]*(n+1)

se=set()
se.add(1)
for  i in range(m):
	x,y=map(int,input().split())
	li[x]-=1
	li[y]+=1
	if x in se:
		se.add(y)
		if li[x]==0:
			se.remove(x)
print(len(se))

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball.  Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i.  Find the number of boxes that may contain the red ball after all operations are performed.

Submission attempts (in order):
n, m = map(int, input().split())
stack = [1]*n
p = [False]*n
p[0] = True

for i in range(m):
    x, y = map(int, input().split())
    stack[x-1] -= 1
    stack[y-1] += 1
    p[y-1] = p[x-1] or p[y-1]
    if stack[0] == 0:
        p[0] = False

for i in p:
    if i:
        ans += 1
print(ans)

n, m = map(int, input().split())
stack = [1]*n
p = [False]*n
p[0] = True

for i in range(m):
    x, y = map(int, input().split())
    stack[x-1] -= 1
    stack[y-1] += 1
    p[y-1] = p[x-1] or p[y-1]
    if stack[x-1] == 0:
        p[x-1] = False

ans = 0
for i in p:
    if i:
        ans += 1
print(ans)


Verdicts: Runtime Error

Accepted
Problem: We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball.  Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i.  Find the number of boxes that may contain the red ball after all operations are performed.

Submission attempts (in order):
n,m = map(int,input().split())
lis = [[1,0] for i in range(n)]
lis[0][1] = 1
ans = 1
for i in range(m):
  a,b = map(int,input().split())
  if lis[a-1][1] == 1:
    lis[b-1][1] = 1
  lis[b-1][0] += 1
  lis[a-1][0] -= 1
  if lis[a-1][0] == 0:
    lis[a-1][1] = 0
for i in range(n):
  if lis[i][1] == 1:
    ans += 1
print(ans)


n,m = map(int,input().split())
lis = [[1,0] for i in range(n)]
lis[0][1] = 1
for i in range(m):
  a,b = map(int,input().split())
  if lis[a-1][1] == 1:
    lis[b-1][1] = 1
    if lis[a-1][0] == 1:
      lis[a-1][1] = 0
  lis[a-1][0] -= 1
  lis[b-1][0] += 1
ans = 0
for i in range(n):
  if lis[i][1] == 1:ans += 1
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball.  Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i.  Find the number of boxes that may contain the red ball after all operations are performed.

Submission attempts (in order):
# coding:utf-8

INF = float('inf')


def inpl(): return list(map(int, input().split()))


N, M = inpl()
move = [inpl() for _ in range(M)]

ans = [0 for _ in range(N)]
ans[0] = 1
box = [1 for _ in range(N)]
# print(ans, box)
for i in range(M):
    x, y = move[i]
    box[x - 1] -= 1
    box[y - 1] += 1
    if ans[x - 1]:
        ans[y - 1] = 1
        if box[x - 1] == 0:
            ans[x - 1] = 0
    # print(ans, box)


print(sum(ans), ans)

# coding:utf-8

import sys

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

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 II(): return int(sys.stdin.readline())
def SI(): return input()


def main():
    n, m = LI()

    B = [1] * n
    R = [0] * n
    R[0] = 1

    for _ in range(m):
        x, y = LI_()

        B[x] -= 1
        B[y] += 1

        
        if R[x]:
            R[y] = 1

        
        if not B[x]:
            R[x] = 0

    return sum(R)


print(main())


Verdicts: Wrong Answer

Accepted
Problem: We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball.  Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i.  Find the number of boxes that may contain the red ball after all operations are performed.

Submission attempts (in order):

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

ball_list = [1 for i in range(N)]
flag_list = [False for i in range(N)]
flag_list[0] = True

for i in range(M):
    x,y = list(map(int,input().split()))
    if flag_list[x-1]:
        flag_list[y-1]=True
        if ball_list[x-1]==1:
            flag_list[x-1]=False
    ball_list[x-1]-=1
    ball_list[y-1]+=1
count=0    
for i in range(M):
    if flag_list[i]:
        count+=1

print(count)

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

ball_list = [1 for i in range(N)]
flag_list = [False for i in range(N)]
flag_list[0] = True

for i in range(M):
    x,y = list(map(int,input().split()))
    if flag_list[x-1]:
        flag_list[y-1]=True
        if ball_list[x-1]==1:
            flag_list[x-1]=False
    ball_list[x-1]-=1
    ball_list[y-1]+=1
count=0    
for i in range(N):
    if flag_list[i]:
        count+=1

print(count)

Verdicts: Runtime Error

Accepted
Problem: We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball.  Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i.  Find the number of boxes that may contain the red ball after all operations are performed.

Submission attempts (in order):
N,M = list(map(int,input().split()))
x = []
y = []
red = [0]
mas = [1 for i in range(N)]

for i in range(M):
    x,y = map(int,input().split())
    x -= 1
    y -= 1
    mas[x] -= 1
    mas[y] += 1
    if x in red:
        if x not in red:
            red.append(y)
        if mas[x] == 0:
            red.remove(x)

print(len(red))

        
    


N,M = list(map(int,input().split()))
x = []
y = []

for i in range(M):
    u,v = map(int,input().split())
    x.append(u-1)
    y.append(v-1)
    
red = [0]
mas = [1 for i in range(N)]

for j in range(M):
    mas[x[j]] -= 1
    mas[y[j]] += 1
    if x[j] in red and x[j] not in red:
        red.append(y[j])
        if mas[x[j]] == 0:
            red.remove(x[j])

print(len(red))

        

N,M = list(map(int,input().split()))
x = []
y = []

for i in range(M):
    u,v = map(int,input().split())
    x.append(u-1)
    y.append(v-1)
    
red = [0]
mas = [1 for i in range(N)]

for j in range(M):
    mas[x[j]] -= 1
    mas[y[j]] += 1
    if x[j] in red:
        if x[j] not in red:
            red.append(y[j])
        if mas[x[j]] == 0:
            red.remove(x[j])

print(len(red))


N,M = list(map(int,input().split()))
x = []
y = []

for i in range(M):
    u,v = map(int,input().split())
    x.append(u-1)
    y.append(v-1)
    
red = [0]
mas = [1 for i in range(N)]

for j in range(M):
    if x[j] == set(red):
        mas[y[j]] += 1
        mas[x[j]] -= 1
        red.append(y[j])
        if mas[x[j]] == 0:
            red.remove(x[j])

print(len(red))

N,M = list(map(int,input().split()))
x = []
y = []
red = [0 for i in range(N)]
mas = [1 for i in range(N)]
red[0] = 1

for i in range(M):
    x,y = map(int,input().split())
    x -= 1
    y -= 1
    mas[x] -= 1
    mas[y] += 1
    if red[x] == 1:
        if red[y] == 0:
            red[y] = 1
        if mas[x] == 0:
            red[x] = 0

print(sum(red))

        
    

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball.  Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i.  Find the number of boxes that may contain the red ball after all operations are performed.

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

s = [0] * n
s[0] = 1
b = [1] * n
for i in range(m):
    x, y = map(int, input().split())
    
    s[y-1] = s[x-1]
    s[x-1] = int(b[x-1] == 1)

    b[x-1] -= 1
    b[y-1] += 1

ans = 0
for i in range(n):
    if s[i] and b[i]:
        ans += 1

print(ans)


n, m = map(int, input().split())

s = [0] * n
s[0] = 1
b = [1] * n
for i in range(m):
    x, y = map(int, input().split())
    if s[x-1]:
        s[y-1] = 1
    if b[x-1] == 1:
        s[x-1] = 0
    b[x-1] -= 1
    b[y-1] += 1

ans = 0
for i in range(n):
    if s[i] and b[i]:
        ans += 1

print(ans)


Verdicts: Wrong Answer

Accepted
Problem: We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball.  Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i.  Find the number of boxes that may contain the red ball after all operations are performed.

Submission attempts (in order):
N, M = [int(_) for _ in input().split()]
XY = [[int(_) - 1 for _ in input().split()] for _ in range(M)]

red = [False] * M
red[0] = True
num = [1] * M

for x, y in XY:
    num[x] -= 1
    num[y] += 1
    if red[x] == True:
        red[y] = True
        if num[x] == 0:
            red[x] = False
print(sum(red))




N, M = [int(_) for _ in input().split()]
XY = [[int(_) - 1 for _ in input().split()] for _ in range(M)]

red = [False] * N
red[0] = True
num = [1] * N

for x, y in XY:
    num[x] -= 1
    num[y] += 1
    if red[x] == True:
        red[y] = True
        if num[x] == 0:
            red[x] = False
print(sum(red))




Verdicts: Runtime Error

Accepted
Problem: We have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball.  Snuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i.  Find the number of boxes that may contain the red ball after all operations are performed.

Submission attempts (in order):
n,m=map(int,input().split())
aru=1
a=[1]*n
ans=set([1])
for i in range(m):
  x,y=map(int,input().split())
  if a[x-1]==0:continue
  else:
    a[x-1]-=1
    a[y-1]+=1
    if aru==x:
      aru=y
      if a[x-1]!=0:
        ans.add(x)
      elif a[x-1]==0 and x in ans:ans.remove(x)
print(len(ans))

n,m=map(int,input().split())
a=[1]*n
ans=set([1])
for i in range(m):
  x,y=map(int,input().split())
  if a[x-1]==0:continue
  else:
    a[x-1]-=1
    a[y-1]+=1
    if x in ans:
      ans.add(y)
      if a[x-1]==0:ans.rempve(x)
print(len(ans))

n,m=map(int,input().split())
aru=1
a=[1]*n
ans=set()
for i in range(m):
  x,y=map(int,input().split())
  if a[x-1]==0:continue
  else:
    a[x-1]-=1
    a[y-1]+=1
    if aru==x:
      aru=y
      if a[x-1]!=0:
        ans.add(x)
      else:ans.remove(x)
print(len(ans))

n,m=map(int,input().split())
aru=1
a=[1]*n
ans=set()
for i in range(m):
  x,y=map(int,input().split())
  if a[x-1]==0:continue
  else:
    a[x-1]-=1
    a[y-1]+=1
    if aru==x:
      aru=y
      if a[x-1]!=0:
        ans.add(x)
print(len(ans))

n,m=map(int,input().split())
aru=1
a=[1]*n
ans=set([1])
for i in range(m):
  x,y=map(int,input().split())
  if a[x-1]==0:continue
  else:
    a[x-1]-=1
    a[y-1]+=1
    if aru==x:
      aru=y
      if a[x-1]!=0:
        ans.add(x)
      else:ans.remove(x)
print(len(ans))

n,m=map(int,input().split())
aru=1
a=[1]*n
ans=set([1])
for i in range(m):
  x,y=map(int,input().split())
  if a[x-1]==0:continue
  else:
    a[x-1]-=1
    a[y-1]+=1
    if aru==x:
      aru=y
      if a[x-1]!=0:
        ans.add(x)
      elif x in ans:ans.remove(x)
print(len(ans))

n,m=map(int,input().split())
a=[1]*n
ans=set([1])
for i in range(m):
  x,y=map(int,input().split())
  if a[x-1]==0:continue
  else:
    a[x-1]-=1
    a[y-1]+=1
    if x in ans:
      ans.add(y)
      if a[x-1]==0:ans.remove(x)
print(len(ans))

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: Snuke is having a barbeque party.  At the party, he will make N servings of _Skewer Meal_.    Example of a serving of Skewer Meal  He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients.  To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.  What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?

Submission attempts (in order):
#-*- coding: utf-8 -*-
N = int(input())
L_list = [int(input()) for n in range(2N)]

L_list.sort()
print(sum(L_list[1::2]))

#-*- coding: utf-8 -*-
N = int(input())
L_list = [int(input()) for n in range(2N)]

L_list.sort()
print(sum(L_list[::2]))

#-*- coding: utf-8 -*-
N = int(input())
L_list = list(map(int, input().split()))
L_list.sort()
print(sum(L_list[::2]))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Snuke is having a barbeque party.  At the party, he will make N servings of _Skewer Meal_.    Example of a serving of Skewer Meal  He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients.  To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.  What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?

Submission attempts (in order):
n=int(input())
arr=list(map(int,input().split()))
arr=arr.sort()
s=0
for i in range(0,(2*n)-1,2):
  s+=arr[i]
print(s)

n=int(input())
arr=list(map(int,input().split()))
arr.sort()
s=0
for i in range(0,(2*n)-1,2):
  s+=arr[i]
print(s)

Verdicts: Runtime Error

Accepted
Problem: Snuke is having a barbeque party.  At the party, he will make N servings of _Skewer Meal_.    Example of a serving of Skewer Meal  He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients.  To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.  What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?

Submission attempts (in order):
n=int(input());print(sum(sorted(list(map(int,input().split())))[::2]))
print("REIWA!")

n=int(input());print(sum(sorted(list(map(int,input().split())))[::2]))
print("RE WA?"

n=int(input())
A=sorted(list(map(int,input().split())))
print(sum(A[::2]))

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Snuke is having a barbeque party.  At the party, he will make N servings of _Skewer Meal_.    Example of a serving of Skewer Meal  He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients.  To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.  What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?

Submission attempts (in order):
n=int(input())
l=list(map(int,input().split()))
l.sort()
s=0
for i in range(n//2):
  s+=l[i]
print(s)

n=int(input())
l=list(map(int,input().split()))
l.sort()
s=0
for i in range(n):
  s+=l[i]
print(s)


n=int(input())
l=list(map(int,input().split()))
l.sort()
s=0
for i in range(2*n)[::2]:
  s+=l[i]
print(s)


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Snuke is having a barbeque party.  At the party, he will make N servings of _Skewer Meal_.    Example of a serving of Skewer Meal  He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients.  To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.  What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?

Submission attempts (in order):
n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
for i in range(0,n/2,2):
    ans+=l[i]
print(ans)

n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
for i in range(0,n/2,2):
    ans+=l[i]
print(ans)n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
for i in range([0,]n[,2]):
    ans+=l[i]
print(ans)

n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
i=0
while i<n*2-1:
    ans+=l[i]
    i+=2
print(ans)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Snuke is having a barbeque party.  At the party, he will make N servings of _Skewer Meal_.    Example of a serving of Skewer Meal  He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients.  To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.  What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?

Submission attempts (in order):
from collections import deque

N, K = map(int, input().split())
T = [[] for i in range(N)]
E = []
for i in range(N-1):
    a, b = map(int, input().split())
    a, b = a-1, b-1
    T[a].append(b)
    T[b].append(a)
    E.append((a, b))


def bfs(n):
    visited = [False] * N
    dist = [0] * N
    queue = deque([n])
    while queue:
        node = queue.pop()
        if visited[node]:
            continue
        visited[node] = True
        for n in T[node]:
            if not visited[n]:
                dist[n] = dist[node] + 1
                queue.appendleft(n)
    return dist


dist = []
for i in range(N):
    dist.append(bfs(i))

ans = float('inf')
if K % 2 == 0:
    
    for i in range(N):
        ans = min(ans, len([d for d in dist[i] if d > K / 2]))
else:
    
    for a, b in E:
        adist = [(1 if min(d1, d2) > (K-1) / 2 else 0) for d1, d2 in zip(dist[a], dist[b])]
        ans = min(ans, sum(adist))

print(ans)


N = int(input())
L = sorted(list(map(int, input().split())))
print(sum(L[::2]))

Verdicts: Runtime Error

Accepted
Problem: Snuke is having a barbeque party.  At the party, he will make N servings of _Skewer Meal_.    Example of a serving of Skewer Meal  He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients.  To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.  What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?

Submission attempts (in order):
n = int(input())
A = list(map(int, input().split())).sort()
ans = 0
for a, b in zip(A, A[1:]):
  ans += a
print(ans)

n = int(input())
A = sorted(list(map(int, input().split())))
ans = 0
flag = True
for i in reversed(range(len(A))):
  if flag is False:
    flag = True
    continue
  if i - 1 < 0:
    continue
  ans += A[i - 1]
  flag = False
print(ans)

Verdicts: Runtime Error

Accepted
Problem: Snuke is having a barbeque party.  At the party, he will make N servings of _Skewer Meal_.    Example of a serving of Skewer Meal  He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients.  To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.  What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?

Submission attempts (in order):
n=int(input())
l=sorted(list(map(int,input().split())),reverse=True)
cnt=0
for i in range(0,2*n,2):
    cnt+=l[i+1]
    print(i)
print(cnt)

n=int(input())
l=sorted(list(map(int,input().split())),reverse=True)
cnt=0
for i in range(0,2*n,2):
    cnt+=l[i+1]
print(cnt)

Verdicts: Wrong Answer

Accepted
Problem: Snuke is having a barbeque party.  At the party, he will make N servings of _Skewer Meal_.    Example of a serving of Skewer Meal  He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients.  To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.  What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?

Submission attempts (in order):
N = int(input())
L = list(map(int,input().split()))
L.sort()
ans = 0
i = 0
while(i<N):
  ans += L[i]
  i += 2

N = int(input())
L = list(map(int,input().split()))
L.sort()
ans = 0
i = 0
while(i<N):
  ans += L[i]
  i += 2
print(ans)

N = int(input())
L = list(map(int,input().split()))
L.sort()
ans = 0
i = 0
while(i<2*N):
  ans += L[i]
  i += 2
print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Snuke is having a barbeque party.  At the party, he will make N servings of _Skewer Meal_.    Example of a serving of Skewer Meal  He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients.  To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.  What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?

Submission attempts (in order):
n = int(input())
a = sorted(list(map(int, input().split())))
ans = 0
for i in range(0,2*n,2):
  ans += i
print(ans)

n = int(input())
a = list(map(int, input().split()))
a.sort()
print(sum(a[::2]))

Verdicts: Wrong Answer

Accepted
Problem: Snuke is having a barbeque party.  At the party, he will make N servings of _Skewer Meal_.    Example of a serving of Skewer Meal  He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients.  To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.  What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?

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

import sys

sys.setrecursionlimit(20000)

l = [[] for i in range(n)]
for i in range(n-1):
    a, b = map(int, input().split())
    l[a-1].append(b-1)
    l[b-1].append(a-1)

def first_search(first, depth):
    record = 0
    for i in l[first]:
        temp = search(first, i, depth-1)
        if record < temp:
            record = temp
    return record + 1

def search(before, now, depth):
    if depth <= 0:
        return 1
    else:
        ans = 1
        for i in l[now]:
            if before != i:
                ans += search(now, i, depth-1)
        return ans

ret = 0    
for i in range(n):
    temp = first_search(i, k)
    if temp > ret:
        ret = temp
        
if ret > n:
    print(0)
else:
    print(n-ret)

n = int(input())

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

ans = 0

l = sorted(l)

for i in range(n):
    ans += l[2*i]
    
print(ans)

Verdicts: Runtime Error

Accepted
Problem: Snuke is having a barbeque party.  At the party, he will make N servings of _Skewer Meal_.    Example of a serving of Skewer Meal  He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients.  To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.  What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?

Submission attempts (in order):
N=input("Enter No. of Servings :")
L=list(map(int,input("Enter skew Lengths").split()))

# no of ingrediants counter 
items=0


while(L):

	# select large and secong large at beggining
	if L[0]<L[1] :
		s_lg=L[0]
		lg=L[1]
	else:
		s_lg=L[1]
		lg=L[0]

	# if more than 2 elements are there in list	
	if len(L)>2:
		for i in range(2,len(L)) :
			if L[i]>=lg:
				s_lg=lg
				lg=L[i]
			elif L[i]>=s_lg :
				s_lg=L[i]

	# after getting largest and sec_largest of remaining list
	# we only count least one and add to indrediants
	items=items+s_lg

	# we remove them and continue operation with remaining list
	L.remove(s_lg)
	L.remove(lg)	

print(items)	

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

items=0

while(L):

	if L[0]<L[1] :
		s_lg=L[0]
		lg=L[1]
	else:
		s_lg=L[1]
		lg=L[0]

	if len(L)>2:
		for i in range(2,len(L)) :
			if L[i]>=lg:
				s_lg=lg
				lg=L[i]
			elif L[i]>=s_lg :
				s_lg=L[i]

	items=items+s_lg

	L.remove(s_lg)
	L.remove(lg)	

print(items)	

Verdicts: Wrong Answer

Accepted
Problem: Snuke is having a barbeque party.  At the party, he will make N servings of _Skewer Meal_.    Example of a serving of Skewer Meal  He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients.  To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.  What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?

Submission attempts (in order):
a = input()
x = sorted(list(map(int,input().split())))
cnt=0
for i in range(a):
  cnt += x[2*i]
print(cnt)

a = input()
x = sorted(list(map(int,input().split())))
cnt=0
for i in range(a-1):
  cnt += x[2*i]
print(cnt)


a = int(input())
x = sorted(list(map(int,input().split())))
cnt=0
for i in range(a-1):
  cnt += x[2*i]
print(cnt)

a = int(input())
print(a)
x = sorted(list(map(int,input().split())))
print(x)
cnt=0
for i in range(a):
  cnt += x[2*i]
print(cnt)

a = int(input())
x = sorted(list(map(int,input().split())))
cnt=0
for i in range(a):
  cnt += x[2*i]
print(cnt)

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: Snuke is having a barbeque party.  At the party, he will make N servings of _Skewer Meal_.    Example of a serving of Skewer Meal  He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients.  To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.  What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?

Submission attempts (in order):
# coding: utf-8
# Your code here!
n = int(input())
l = list(map(int, input().split()))
l.sort()
ans = 0
for i in range(n):
    if i % 2 == 0:
        ans += l[i]

print(ans)


# coding: utf-8
# Your code here!
n = int(input())
l = list(map(int, input().split()))
l.sort()
ans = 0
for i in range(2 * n):
    if i % 2 == 0:
        ans += l[i]

print(ans)


Verdicts: Wrong Answer

Accepted
Problem: Snuke is having a barbeque party.  At the party, he will make N servings of _Skewer Meal_.    Example of a serving of Skewer Meal  He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients.  To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.  What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?

Submission attempts (in order):
N = int(input())

s = map(int,input().split())

list(s).sort(reverse=True)

sum = 0

for i in range(N):
  sum = sum +list(s)[2*i]

print(sum)

N = int(input())

s = input().split()

s.sort(reverse=True)

sum = 0

for i in range(N):
  sum = sum + s[2*i]

print(sum)

N = int(input())

s = map(int,input().split())

s.sort()

sum = 0

for i in range(N):
  sum = sum + s[2*i+1]

print(sum)

N = int(input())

s = map(int,input().split())

s.sort(reverse=True)

sum = 0

for i in range(N):
  sum = sum + s[2*i]

print(sum)

N = int(input())

s = map(int,input().split())

s.sort()

sum = 0

for i in range(N):
  sum = sum + s[2*i]

print(sum)

N = int(input())

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

s.sort(reverse=True)

sum = 0

for i in range(N):
  sum = sum + s[2*i]

print(sum)

N = int(input())

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

s.sort()

sum = 0

for i in range(N):
  sum = sum + s[2*i]

print(sum)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: Snuke is having a barbeque party.  At the party, he will make N servings of _Skewer Meal_.    Example of a serving of Skewer Meal  He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients.  To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.  What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?

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

ans = 0
for i in range(len(n)):
  a = l[2*i]
  b = l[2*i+1]
  ans =+ min(a,b)

print(ans)

n = input()
l = map(int, input().split())
l = sorted(l)
 
ans = 0
for i in range(len(n)):
  a = l[2*i]
  b = l[2*i+1]
  ans =+ min(a,b)
 
print(ans)

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

ans = 0
for i in range(n):
    a = l[2 * i]
    b = l[2 * i + 1]
    ans = ans + min(a, b)

print(ans)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Snuke is having a barbeque party.  At the party, he will make N servings of _Skewer Meal_.    Example of a serving of Skewer Meal  He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients.  To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.  What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?

Submission attempts (in order):
input_word = input()
input_list = input_word.split(" ")
N = int(input_list[0])
K = int(input_list[1])
input_word = input()
tmp_list = input_word.split(" ")
input_list = [ int(i) for i in tmp_list ]

while True:
  flag = 0
  for i in range(1,N):
    number = input_list.index(i)
    number_1 = input_list.index(i+1)
    if number - number_1 >= K:
        input_list[number_1],input_list[number] = input_list[number],input_list[number_1]
        flag = 1
        break
  if flag == 0:
    break

for i in input_list:
  print(i)
      

input_word = input()
N = int(input_word)
input_word = input()
tmp_list = input_word.split(" ")
input_list = [ int(i) for i in tmp_list ]

input_list.sort()
print(input_list)
output = 0
for i in range(N):
  output += input_list[2*i]

print(output)
      

input_word = input()
N = int(input_word)
input_word = input()
tmp_list = input_word.split(" ")
input_list = [ int(i) for i in tmp_list ]
input_list.sort()
output = 0
for i in range(N):
  output += input_list[2*i]
print(output)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Snuke is having a barbeque party.  At the party, he will make N servings of _Skewer Meal_.    Example of a serving of Skewer Meal  He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients.  To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.  What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?

Submission attempts (in order):
n = int(input())
table = list(map(int,input().split()))
table.sort()
count = 0
for i in range(1,n+1):
    if i%2 = 1:
        count += table[i]
    else:
        pass
print(count)

n = int(input())
table = list(map(int,input().split()))
table.sort()
count = 0
for i in range(n):
    if i%2 == 0:
        count += table[i]
    else:
        pass
print(count)

n = int(input())
table = list(map(int,input().split()))
table.sort()
count = 0
for i in range(n):
    if i%2 = 0:
        count += table[i]
    else:
        pass
print(count)

n = int(input())
table = list(map(int,input().split()))
table.sort()
count = 0
for i in range(2*n):
    if i%2 == 0:
        count += table[i]
    else:
        pass
print(count)

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: Snuke is having a barbeque party.  At the party, he will make N servings of _Skewer Meal_.    Example of a serving of Skewer Meal  He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients.  To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.  What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?

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

L.sort()
ans = 0
for i in range(0, 2*N, 2):
    ans += min(L[i], L[i+1])

print(ans)

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

L.sort()
ans = 0
for i in range(0, 2*n, 2):
    ans += min(L[i], L[i+1])

print(ans)

Verdicts: Runtime Error

Accepted
Problem: Snuke is having a barbeque party.  At the party, he will make N servings of _Skewer Meal_.    Example of a serving of Skewer Meal  He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients.  To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.  What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?

Submission attempts (in order):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
N, X = list(map(int, input().split()))
sum_ = X
prev = X
next = N - X
i = 0
while True:
    num = prev // next
    if i == 0:
        sum_ += 2 * num * next
    elif i % 2 == 1:
        sum_ += 2 * num * next - next
    else:
        sum_ += 2 * num * next - next
    mod_ = prev % next
    if mod_ == 0:
        break
    sum_ += next
    prev = next
    next = mod_
    i += 1
print(sum_)

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
Ls = list(map(int, input().split()))
sorted_ = sorted(Ls)
list_ = []
for i, x in enumerate(sorted_):
    if i % 2 == 0:
        list_.append(x)
sum_ = sum(list_)
print(sum_)

Verdicts: Runtime Error

Accepted
Problem: Snuke is having a barbeque party.  At the party, he will make N servings of _Skewer Meal_.    Example of a serving of Skewer Meal  He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients.  To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.  What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?

Submission attempts (in order):
N = int(input())
L = list(map(int, input().split()))
L.sort()
sum(L[::2])

N = int(input())
L = list(map(int, input().split()))
L.sort()
print(sum(L[::2]))

Verdicts: Wrong Answer

Accepted
Problem: Snuke is having a barbeque party.  At the party, he will make N servings of _Skewer Meal_.    Example of a serving of Skewer Meal  He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients.  To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.  What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?

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

x.sort()
ans=0

for i range(n):
  if i%2==1:
    pass
  else:
    ans+=min(x[i],x[i+1])
    
print(ans)

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

x.sort()
ans=0

for i in range(n):
  if i%2==1:
    pass
  else:
    ans+=min(x[i],x[i+1])
    
print(ans)


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

x.sort()
ans=0

for i range(n):
  ans=+x[i*2]
    
print(ans)


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

x.sort()

ans = 0

for i range(n):
  ans = ans + x[i*2]
    
print(ans)


n=int(input())

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

x.sort()

ans = 0

for i range(n):
  ans = ans + x[i*2]
    
print(ans)


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

x.sort()
ans=0

for i range(n):
  ans+=x[i*2]
    
print(ans)


n=int(input())
a=[]
cou=0

for i in range(n*2):
  a[i]=int(input())
  
a.sort()
for i*2 in range(n):
  cou+=min(a[i],a[i+1])
  
print(cou)

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

x.sort()
ans=0

for i range(n):
  ans=ans+x[i*2]
    
print(ans)


n= int(input())

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

x.sort()

ans = 0

for i range(n):
  ans = ans + x[i*2]
    
print(ans)


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

x.sort()

ans=0

for i range(n):
  ans = ans + x[i*2]
    
print(ans)


n = int(input())

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

x.sort()

ans = 0

for i range(n):
  ans = ans + x[i*2]
    
print(ans)

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

x.sort()

ans=0

for i range(n):
  ans=ans+x[i*2]
    
print(ans)


n = int(input())

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

x.sort()

ans = 0

for i range(n):
  ans = ans + x[i*2]
    
print(ans)


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

x.sort()
ans=0

for i range(n):
  ans=ans+x[i*2]
    
print(ans)


n = int(input())

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

x.sort()

ans = 0

for i range(n):
  ans = ans + x[i*2]
    
print(ans)

n = int(input())

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

x.sort()

ans = 0

for i in range(n):
  ans = ans + x[i*2]
    
print(ans)

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Snuke is having a barbeque party.  At the party, he will make N servings of _Skewer Meal_.    Example of a serving of Skewer Meal  He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients.  To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.  What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?

Submission attempts (in order):
class Scanner:
    def readint(self): return int(input())
    def readstring(self): return input().rstrip()
    def readline(self): return list(map(int, input().split()))
    def reads(self): return list(input().split())
    def newmat(self, n, x): return [[x for i in range(n)] for j in range(n)]

sc = Scanner()
n = sc.readint()
L = sc.readline()
L.sort()
print(L[::2])
print(sum(L[::2]))

d=input()
print(sum(sorted(list(map(int, input().split())))[::2]))

Verdicts: Wrong Answer

Accepted
Problem: Snuke is having a barbeque party.  At the party, he will make N servings of _Skewer Meal_.    Example of a serving of Skewer Meal  He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients.  To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.  What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?

Submission attempts (in order):
input()
L=[int(l) for l in input().split()]
print(sum(L[1::2]))

input()
L=[int(l) for l in input().split()]
L.sort(reverse=True)
print(sum(L[1::2]))

Verdicts: Wrong Answer

Accepted
Problem: Snuke is having a barbeque party.  At the party, he will make N servings of _Skewer Meal_.    Example of a serving of Skewer Meal  He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients.  To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.  What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?

Submission attempts (in order):
n=int(input())
l=list(map(int,input().split()))
l.sort()
sum=0
for x in range(0,n*2,2):
    sum+=max(l[x:x+2])
print(sum)


n=int(input())
l=list(map(int,input().split()))
l.sort()
sum=0
for x in range(0,n*2+1,2):
    sum+=min(l[x:x+2])
print(sum)


n=int(input())
l=list(map(int,input().split()))
l.sort()
sum=0
for x in range(0,n*2,2):
    sum+=min(l[x:x+2])
print(sum)


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Snuke is having a barbeque party.  At the party, he will make N servings of _Skewer Meal_.    Example of a serving of Skewer Meal  He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients.  To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.  What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?

Submission attempts (in order):
N = input()
Li = map(int, input().split(" "))
Li.sort()
total = 0
for i in Li[0::2]
    total += i
print(total)


N = input()
Li = list(map(int, input().split(" ")))
Li.sort()
total = 0
for i in Li[0::2]:
    total += i
print(total)


Verdicts: Runtime Error

Accepted
Problem: Snuke is having a barbeque party.  At the party, he will make N servings of _Skewer Meal_.    Example of a serving of Skewer Meal  He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients.  To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.  What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?

Submission attempts (in order):
n=input()
a=input().split()
a=[int(i) for i in a]
a=a.sorted()
count=0
ans=0
for i in a:
  if count%2==0:
    ans+=i
  count+=1

n=input()
a=input().split()
a=[int(i) for i in a]
a.sort()
count=0
ans=0
for i in a:
  if count%2==0:
    ans+=i
  count+=1
print(ans)

Verdicts: Runtime Error

Accepted
Problem: Snuke is having a barbeque party.  At the party, he will make N servings of _Skewer Meal_.    Example of a serving of Skewer Meal  He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i-th skewer is L_i. Also, he has an infinite supply of ingredients.  To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers. Let the length of the shorter skewer be x, then the serving can hold the maximum of x ingredients.  What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?

Submission attempts (in order):
m=0
n=int(input())
kushi= list(map(int,input().split()))
kushi.sort()
print(kushi)

if len(kushi) %2==1:
	del kushi[-1]

for i in range(0,len(kushi)-1,2):
	if kushi[i]>kushi[i+1]:
		m+=kushi[i+1]
	else:
		m+=kushi[i]
print(m)

m=0
n=int(input())
kushi= list(map(int,input().split()))
kushi.sort()

if len(kushi) %2==1:
	del kushi[-1]

for i in range(0,len(kushi)-1,2):
	if kushi[i]>kushi[i+1]:
		m+=kushi[i+1]
	else:
		m+=kushi[i]
print(m)

Verdicts: Wrong Answer

Accepted