Problem:


Score : 200 points

Problem Statement

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?

Constraints

1≦N≦100

1≦L_i≦100

For each i, L_i is an integer.

Input

The input is given from Standard Input in the following format:

N
L_1 L_2 ... L_{2N}

Output

Print the maximum total number of ingredients that Snuke's N servings of Skewer Meal can hold.

Sample Input 1

2
1 3 1 2

Sample Output 1

3

If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold 1 and 2 ingredients, for the total of 3.

Sample Input 2

5
100 1 2 3 14 15 58 58 58 29

Sample Output 2

135



Sample input:
2
1 3 1 2


Sample output:
3

Submission status: Accepted

Solution code:
import numpy as np
a = input()
c = input().split()

d = [int(i) for i in c]
d.sort()

print(sum(d[0::2]))

Submission status: Accepted

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

l.sort()

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

Submission status: Accepted

Solution code:
N = int(input())
L = sorted(list(map(int,input().split())))
ans = 0
for i in range(2*N):
    if i % 2 == 1:
        continue
    else:
        ans += L[i]
print(ans)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

a.sort()
ans = 0
for i in range(2*n):
	if not i&1:
		ans += a[i]

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int,input().split()))
L.sort()
#print(L)
ans = 0
for i in range(0,2*N,2):
    ans += L[i]
print(ans)

Submission status: Accepted

Solution code:
n=int(input())

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

L.sort()

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

L = sorted(L)

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
_,a=open(0);print(sum(sorted(map(int,a.split()))[::2]))

Submission status: Accepted

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

l.sort()

sum = 0
for i in range( 0, 2*n, 2 ) :
  sum += l[i]

print( sum )

Submission status: Accepted

Solution code:
# 2019/08/15

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

Submission status: Accepted

Solution code:
x=input()
y = sorted(list(map(int, input().split())))
i=1
z=0
for i in range(int(len(y)/2)):
     z+=y[-2*i]
     i+=1

print(z)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, fractions, itertools


def solve(N: int, L: "List[int]"):
    L = sorted(L)
    res = 0
    for i in range(N):
        res += min(L[2*i], L[2*i+1])
    print(res)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    L = [ int(next(tokens)) for _ in range(2*N) ]  # type: "List[int]"
    solve(N, L)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
L = list(map(int, input().split()))
L.sort()
array_L = []
for m in [i * 2 for i in range(n)]:
    array_L.append(L[m])
print(sum(array_L))

Submission status: Accepted

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

L.sort()
ans=0

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

a.sort(reverse=True)

for i in range(1,n+1):
    ans += a[2*i-1]

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
lst = list(map(int,input().split()))
lst.sort()
s = sum(lst[0::2])
print(s)

Submission status: Accepted

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

L.sort(reverse=True)

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

print(ans)

Submission status: Accepted

Solution code:
input();print(sum(sorted(list(map(int,input().split())))[0::2]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
L.sort()
ans = []

for i in range(0, 2*N, 2):
    ans.append(L[i])

ans = sum(ans)
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int,input().split()))
l = sorted(l)
ans = 0
for i in range(0,2*n-1,2):
    ans +=min(l[i],l[i+1])
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
l.sort()
l.reverse()
print(sum(l[1::2]))

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int, input().split()))
l.sort()
print(sum([l[i] for i in range(2*n) if i % 2 == 0]))

Submission status: Accepted

Solution code:
# 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)

Submission status: Accepted

Solution code:
n=int(input())
l=[int(i) for i in input().split()]
l.sort()
a=0
for i in range(n):
  a+=l[i*2]
print(a)

Submission status: Accepted

Solution code:
a = int(input())
b = list(map(int, input().split()))
b = sorted(b, reverse=True)
c = 0
for i in range(1, len(b), 2):
    c += min(b[i], b[i-1])
print(c)

Submission status: Accepted

Solution code:
n = int(input())
ls = sorted(list(map(int, input().split())))
total = 0
for i in range(n):
    total += min(ls[2*i], ls[2*i+1])
print(total)

Submission status: Accepted

Solution code:
# AGC001A - BBQ Easy
def main():
    n = int(input())
    L = sorted(map(int, input().rstrip().split()))
    print(sum(L[::2]))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n=int(input())
l=sorted(list(map(int, input().split())))
ll=l[::2]
print(sum(ll))

Submission status: Accepted

Solution code:
a = int(input())
b = list(map(int, input().split()))
b = sorted(b, reverse=True)
c = 0
d = 0
for i in range(1, len(b), 2):
    c += min(b[i], b[i-1])
    d += 1
    if d == a:
        break
print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")
#logging.disable(logging.CRITICAL)

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

    L_1.sort()

    logging.info(L_1)

    print(sum(L_1[::2]))
    
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
L.sort()
ans = 0
for i in range(N):
    ans += L[2 * i]

print (ans)

Submission status: Accepted

Solution code:

def main():
    num = int(input())
    data = list(map(int, input().split()))
    data.sort()
    ans = sum(data[::2])
    print(ans)



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def MI():
    return map(int,input().split())
def I():
    return int(input())
def LI():
    return [int(i) for i in input().split()]
    
n=I()
a=LI()
a.sort()

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

L.sort()

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())*2
arr = list(map(int, input().split()))
arr = sorted(arr)
sum = 0
for i in range(0,n,2):
  sum += arr[i]
print(sum)

Submission status: Accepted

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

L.sort()
ans = 0
for i in range(0, len(L), 2):
    ans += L[i]
print(ans)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

    L = sorted(L)
    print(sum(L[::2]))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
vlist = []
ans = 0

for i in range(N):
  a = max(L)
  L.remove(a)
  b = max(L)
  L.remove(b)
  if a < b:
    vlist.append(a)
  else:
    vlist.append(b)

for i in range(N):
  ans += vlist[i]
  
print(ans)

Submission status: Accepted

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

print(sum(l[0::2]))

Submission status: Accepted

Solution code:
n=int(input())
L=sorted(list(map(int,input().split())))
ans=0
for i in range(n):
    ans+=L[2*i]
print(ans)

Submission status: Accepted

Solution code:
X = int(input())
L = list(map(int,input().split()))
L.sort()
ans = 0
for i in range(X):
    ans += min(L[2*i], L[2*i+1])

print(ans)

Submission status: Accepted

Solution code:
n = input()
l = list(map(int, input().split()))
def bubble_sort(arr):
    change = True
    while change:
        change = False
        for i in range(len(arr) - 1):
            if arr[i] > arr[i + 1]:
                arr[i], arr[i + 1] = arr[i + 1], arr[i]
                change = True
    return arr
ans=[]
L= bubble_sort(l)
k=0
for i in range(0,len(l),2):
    k=k+L[i]
print(k)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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

for i in range(N * 2):
    if i % 2 == 0:
        ctr += a[i]
print(ctr)

Submission status: Accepted

Solution code:
import numpy as np
N =int(input())
input_line2 =(input())
kushisashi_number = list(map(int,np.zeros(N)))

no_kushi = int(N)*2
kushi_length = list(map(int,input_line2.split()))

kushisashi=sorted(kushi_length,reverse=True)
for n in range(N):
    kushisashi_number[n] = kushisashi[2*n+1]
    
print(sum(kushisashi_number))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(sum(L[::2]))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
l=sorted(l)
s=0
for i in range(len(l)):
  if i%2==0:s+=l[i]
print(s)

Submission status: Accepted

Solution code:
n = input()
a = sorted(list(map(int, input().split())))
ans = 0
for i in range(0, len(a), 2):
  ans += a[i]
print(ans)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    L = list(map(int, input().split()))
    L.sort()
    ans = sum(L[::2])
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
a = int(input())
b = list(map(int, input().split()))
b.sort()
c = 0
for i in range(len(b)-1, 0, -2):
    c += min(b[i], b[i-1])
print(c)

Submission status: Accepted

Solution code:
N = int(input()) * 2
Ls= list(map(int,input().split(" ")))
Ls.sort()
ans = 0
for i in range(0,N,2):
    ans+= Ls[i]

print(ans)

Submission status: Accepted

Solution code:
wood = input()

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

lis_1.sort()

guzai = 0

for i in range(int(wood)):
  max_gu = min(lis_1[2*i],lis_1[2*i+1])
  guzai += int(max_gu)
print(guzai)

Submission status: Accepted

Solution code:
N = input() 
Inp = list(input().split())
Inp = [int(i) for i in Inp]
Inp.sort()
ans = 0
for i in range(0,len(Inp),2) :
	kushi = [int(Inp[i]),int(Inp[i+1])]
	ans += min(kushi)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print(sum(L[::2]))

Submission status: Accepted

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

print(sum(L[0::2]))

Submission status: Accepted

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

ans = 0

for i in range(N):
    ans += length[(i*2)]

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
num_list = [ int(v) for v in input().split() ]
print(sum(sorted(num_list)[::2]))

Submission status: Accepted

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

L.sort(reverse=True)

ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
*L, = map(int, input().split())
L = sorted(L)
ans = sum(L[::2])
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
l = [int(i) for i in input().split()]
l.sort()
print(sum([l[i] for i in range(len(l)) if i%2 == 0]))

Submission status: Accepted

Solution code:
N = int(input())
L = sorted(list(map(int,input().split())))
ans=0
for i in range(0,2*N,2):
    ans += min(L[i],L[i+1])
print(ans)

Submission status: Accepted

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

print(sum(L[::2]))

Submission status: Accepted

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

ans = 0
for i in range(N):
  ans += L[i * 2]
  
print(ans)

Submission status: Accepted

Solution code:
N = [int(v) for v in input().split()]
L = [int(v) for v in input().split()]
L.sort()
L_even=L[0::2]
goukei=sum(L_even)
print(str(goukei))

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
L.sort(reverse = True)
sum = 0
for i in range(0, N):
	sum += L[2*i+1]
print(sum)

Submission status: Accepted

Solution code:
def BBQ_easy(N: int, L: list)->int:
    L.sort()
    return sum(L[0::2])


if __name__ == "__main__":
    N = int(input())
    L = [int(s) for s in input().split()]

    ans = BBQ_easy(N, L)
    print(ans)

Submission status: Accepted

Solution code:
N = int(input())
L = [int(x) for x in input().split()]
L.sort()
answer = sum(L[::2])
print(answer)

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int,input().split()))
l = sorted(l)
ans = 0
for i in range(len(l)):
    if i%2==0:
        ans += l[i]
print(ans)

Submission status: Accepted

Solution code:
###template###
import sys
def input(): return sys.stdin.readline().rstrip()
def mi(): return map(int, input().split())
###template###

N = int(input())
Ks = sorted(list(mi()), reverse=True)

i = 0
ans = 0
while i < (2*N):
  ans += min(Ks[i],Ks[i+1])
  i += 2

print(ans)

Submission status: Accepted

Solution code:
N=int(input())
L=list(map(int,input().split()))
L.sort()
S=0
for i in L[::2]:
  S=S+i
print(S)

Submission status: Accepted

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

ans = 0
l.sort()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
A - BBQ Easy
https://atcoder.jp/contests/agc001/tasks/agc001_a

"""
import sys


def solve(N, L):
    ans = 0
    while L:
        a = L.pop()
        b = L.pop()
        ans += min(a, b)
    return ans


def main(args):
    N = int(input())
    L = sorted(map(int, input().split()))
    ans = solve(N, L)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
N = int(input())*2
N -= 1
inp = input()
skewers=[]
for num in inp.split():
    skewers.append(int(num))
skewers = sorted(skewers)
total = 0
for i in range(0,N,2):
  num = int(skewers[i])
  total+=num
print(total)

Submission status: Accepted

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

l.sort()

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

Submission status: Accepted

Solution code:
import sys

def main():
    sinputl = sys.stdin.readline

    num_skewer = int(sinputl().strip())
    input = [int(x) for x in sinputl().split()]
    input.sort()

    count = 0

    for i in range(num_skewer):
        count += input[i * 2]

    print(count)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n=int(input())
l=sorted(map(int,input().split()))
ans=0
while len(l)>1:
    ans+=min(l.pop(),l.pop())
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int,input().split()))
L.sort()
maximum = 0
for i in range(N):
  maximum += L[2*i]
print(maximum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

l.sort()

cnt = 0
for i in range(2*n):
    if i%2 == 0:
        cnt += l[i]
        
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num_meals = int(input())
skewers = list(map(int, input().split()))
skewers.sort()
ingredients = 0
for skewer in range(0,(len(skewers) - 1),+2):
    ingredients = ingredients + skewers[skewer]
print(ingredients)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
b = list(map(int,input().split()))
b.sort()
j = 0
num = 0
for i in range(a):
  c = b[j:j+2]
  num += min(c)
  j += 2
print(num)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
M=sorted(list(map(int,input().split())))
if N%2==1:
    M.pop(-1)
print(sum(M[::2]))

Submission status: Accepted

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

print(sum(sorted(L)[::2]))

Submission status: Accepted

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

Submission status: Accepted

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

L.sort()

print(sum(L[::2]))

Submission status: Accepted

Solution code:
N =int(input())
Ls = sorted(map(int,input().split()))
ans = [min(Ls[i+1],Ls[i]) for i in range(0,len(Ls)-1,2)]
print(sum(ans))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
#!/usr/bin/python
# -*- Coding: utf-8 -*-
import sys

L = [input()]
L = sorted(list(map(int,input().split())), key= lambda x: -x)
test = lambda L, S=0, f=lambda f, L, S : f(f,L[2:],S+L[1]) if L else print(S): f(f, L, S)
test(L)

Submission status: Accepted

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

Submission status: Accepted

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

L_i.sort(reverse=False)

print(sum(L_i[0::2]))

Submission status: Accepted

Solution code:
n = int(input()) * 2
l = input().split()
s = []
for i in range(n):
  s.append(int(l[i]))
s.sort(reverse=True)
sum  = 0
for qq in range(1,n,2):
  sum = sum + s[qq]
  
print(sum)

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
 
L_s = sorted(L)
A = sum(L_s[0::2])
 
print(A)

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
res = 0
L.sort()
for i in range(len(L)%2, len(L), 2):
    res += L[i]

print(res)

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
ans=0
b=[]
for k in range(2*n):
 for i in range(2*n):
  if a[i]==min(a):
    b.append(a[i])
    a[i]=101
for s in range(n):
  ans+=b[2*s]
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
L=[int(i) for i in input().split()]
L.sort()
K=[]
for i in range(N):
    K.append(L[i*2])

print(sum(K))

Submission status: Accepted

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

li.sort(reverse=True)
re = sum(li[1::2])
print(re)

Submission status: Accepted

Solution code:
n=int(input())
l=[int(i) for i in input().split()]
l.sort()
ans=0
for i in range(2*n):
    if i%2==0:
        ans+=l[i]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
l=[int(i) for i in input().split()]
l.sort()
ans=0
for i in range(2*n):
    if i%2==0:
        ans+=l[i]
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
l = sorted(L)
cnt = 0
for i in range(N):
  cnt += l[2*i]
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int,input().split()))
l = sorted(l)[::-1]
res = 0
for i in range(1,2 * n,2):
    res += l[i]
print(res)

Submission status: Accepted

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

sum = 0
for i in range(0,2*N,2):
    sum += L[i]
print(sum)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
a.sort()
print(sum(a[0::2]))

Submission status: Accepted

Solution code:
n=int(input())
print(sum(sorted([int(i) for i in input().split()])[-2::-2]))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

res =[]
for i in range(N):
    res.append(a[2*i])

print(sum(res))

Submission status: Accepted

Solution code:
N = int(input())
a = list(int(i) for i in input().split())
list.sort(a, reverse=True)
ans = 0
for i in range(N*2):
    if i%2 == 1:
        ans += a[i]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

l.sort()

ans = 0
for i in range(0,len(l),2):
    ans += l[i]

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Ls.sort(reverse=True)
res = sum(Ls[1::2])

print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N =int(input())
L =[int(j) for j in input().split()]
L.sort()
ans=0
for i in range(0,2*N-1,2):
    ans+=min(L[i:i+2])
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
L.sort()
ans = 0
for i in range(N):
  ans += L[2 * i]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
tmp_lst = input().split()
length_lst = []
#print(2*N)
for i in range(2*N):
#    print(tmp_lst[i])
    length_lst.append(int(tmp_lst[i]))
length_lst.sort()
 
output = 0
for i in range(0, 2*N, 2):
    output += length_lst[i]
 
print(output)

Submission status: Accepted

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

lList.sort()

result = 0
for l, ll in zip(lList[::2], lList[1::2]):
    result += min(l,ll)

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

total = 0

for i in range(len(L)):
    if i % 2 == 0:
        total += L[i]
        
print(total)

Submission status: Accepted

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

sum = 0
for i in range(N * 2):
  if i % 2 == 1:
    sum += min(L[i-1], L[i])

print(sum)

Submission status: Accepted

Solution code:
n=int(input())
arr=list(map(int,input().split()))
arr=sorted(arr)
ans=0
for i in range(len(arr)):
  if i%2==0:
    ans+=arr[i]
print(ans)

Submission status: Accepted

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

cnt=0
for i in range(n):
    cnt += l[2*i]

print(cnt)

Submission status: Accepted

Solution code:
N = int(input())

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

L.sort()

ans = 0
for i in range(0, len(L), 2):
    ans += L[i]

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
kushi = list(map(int, input().split()))
kushi.sort()
setkushi = [min(kushi[2*i], kushi[2*i+1]) for i in range(n)]
print(sum(setkushi))

Submission status: Accepted

Solution code:
N = int(input())
L = [int(i) for i in input().split()]
L.sort()
L = L[0::2]
print(sum(L))

Submission status: Accepted

Solution code:
n,l=open(0);print(sum(sorted(map(int,l.split()))[::2]))

Submission status: Accepted

Solution code:
import math
def getInt(): return int(input())
def getIntList(): return [int(x) for x in input().split()]
def zeros(n): return [0]*n
def zeros2(n, m): return [zeros(m) for i in range(n)] # obsoleted zeros((n, m))で代替

class Debug():
    def __init__(self):
        self.debug = True
 
    def off(self):
        self.debug = False
 
    def dmp(self, x, cmt=''):
        if self.debug:
            if cmt != '':
                w = cmt + ': ' + str(x)
            else:
                w = str(x)
            print(w)
        return x

def prob():  # WA 2
    d = Debug()
    d.off()
    N = getInt()
    d.dmp((N), 'N')
    L = getIntList()
    d.dmp((L), 'L')
    L.sort()
    count = 0
    for i in range(N):
        count += min(L[i*2], L[i*2+1])
    return count


ans = prob()
print(ans)

Submission status: Accepted

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

def quicksort(array):
    if len(array) < 2:
        return array
    else:
        pivot = array[0]
        less = [i for i in array[1:] if i <= pivot]
        greater = [i for i in array[1:] if i > pivot]
        return quicksort(less) + [pivot] + quicksort(greater)

guzai = 0

for i in range(int(N)):
    guzai += int(quicksort(L)[int(2*i)]) 

print (guzai)

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int,input().split()))
L.sort()
ans = 0
for i in range(0,2*N,2):
    ans += L[i]
print(ans)

Submission status: Accepted

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

Ls.sort()
ans = 0
for i in range(0, len(Ls), 2):
    ans += min(Ls[i], Ls[i + 1])

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
c=list(map(int, input().split()))
c.sort()
Max = 0
for i in range(len(c)):
    if i%2 == 0:
        Max = Max + c[i]
    else:
        None
print(Max)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int,input().split()))
L.sort()
count = 0
for i in range(N):
    count += L[2*i]
print(count)

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
ans = 0
L.sort()
for i in range(N):
  ans += L[2*i]
print(ans)

Submission status: Accepted

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

L.sort()

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

print(sum)

Submission status: Accepted

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

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

L.sort()
SUM = 0
for i in range(N):
    x = L.pop()
    y = L.pop()
    if x < y:
        SUM = SUM + x
    elif x >= y:
        SUM = SUM + y

print(SUM)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
s = list(map(int,input().split()))
s.sort()
sum = 0

for i in range(0,2*n,2):
  sum += s[i]
print(sum)