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:
N = int(input())
L = list(map(int, input().split()))
L = sorted(L)
num = 0
for i in range(N):
    num += L[2 * i]

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

Submission status: Accepted

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

Submission status: Accepted

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

l_list.sort()

result = 0

for i in range(0, 2*N, 2):
    l1 = l_list[i]
    result += l1
print(result)

Submission status: Accepted

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

l_list.sort()

result = 0

for i in range(0, 2*N, 2):
    l1 = l_list[i]
    l2 = l_list[i+1]

    min_l = min(l1, l2)
    result += min_l
print(result)

Submission status: Accepted

Solution code:
n = int(input())

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

print(sum(map(min, zip(a[::2], a[1::2]))))

Submission status: Accepted

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

l.sort()
l.reverse()

for i in range(n):
	point = 1 + 2*i
	res += l[point]
else:
	print(res)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections

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

LL = []
dic = collections.Counter(L)
ans = 0
for k,v in dic.items():
    if v == 1:
        LL.append(k)
    else:
        ans += k*(v//2)
        if v%2 == 1:
            LL.append(k)

LL = sorted(LL)
for l in LL[::2]:
    ans += l

print(ans)

Submission status: Accepted

Solution code:
from sys import stdin


def main() -> None:
    n = next_int()
    l = [next_int() for _ in range(2 * n)]
    l.sort()

    ans = sum(l[::2])
    print(ans)


def next_int() -> int:
    return int(next_str())


def next_str() -> str:
    result = ""
    while True:
        tmp = stdin.read(1)
        if tmp.strip() != "":
            result += tmp
        elif tmp != '\r':
            break
    return result


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from sys import stdin


def main() -> None:
    n = next_int()
    l = [next_int() for _ in range(2 * n)]
    l.sort()

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


def next_int() -> int:
    return int(next_str())


def next_str() -> str:
    result = ""
    while True:
        tmp = stdin.read(1)
        if tmp.strip() != "":
            result += tmp
        elif tmp != '\r':
            break
    return result


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A = int(input())
rate = []
rate = list(map(int,input().strip().split(' ')))
rate.sort(reverse=True)
i = 0
sum = 0
while i < A :
    sum = sum + rate[2*i+1]
    i = i + 1
print(sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input()
datas = sorted(map(int, input().split()), reverse=True)
print(sum([min(datas[x:x+2]) for x in range(0, len(datas), 2)]))

Submission status: Accepted

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

ret = 0

for i in range(n):
  
  pair1 = max(lis)
  lis.remove(pair1)
  pair2 = max(lis)
  lis.remove(pair2)
  
  ret += pair2
  
print(ret)

Submission status: Accepted

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

Submission status: Accepted

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

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:
n = int(input())
l = [int(i) for i in input().split()]
a = 0
l.sort()
for i in range(len(l)):
    if i % 2 == 0:
        a = a + l[i]
print(a)

Submission status: Accepted

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

Submission status: Accepted

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

count=0
index=0
while index < len(listL):
    count+=listL[index]
    index+=2

print(count)

Submission status: Accepted

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

l.sort(reverse = True)

ans = 0

for i in range(len(l)):
    if i % 2 == 1:
        ans += l[i]

print(ans)

Submission status: Accepted

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

l.sort(reverse=True)
ans = 0
for i in range(len(l)):
    if i%2:
        ans += l[i]

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(raw_input())
L = map(int,raw_input().split())
L.sort(reverse = True)
ans = 0
for i in xrange(N):
    ans += min(L[2*i],L[2*i+1])
print ans

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())
a = list(map(int,input().split()))
a.sort()
print(sum(a[::2]))

Submission status: Accepted

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

Submission status: Accepted

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

A.sort()

ans = 0

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

Submission status: Accepted

Solution code:
n = input()

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

s = 0

arr.sort()

arr = arr[::2]

for i in arr:
	s += i
	

print(s)

Submission status: Accepted

Solution code:
N = int(input())
L = sorted(map(int, input().split()))
print(sum(min(a, b) for a, b in zip(L[::2], L[1::2])))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input();print(sum(sorted(map(int,input().split()))[::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())
L = list(map(int,input().split()))
L.sort()
K = []
for i in range(N):
  K.append(L[2*i])
print(sum(K))

Submission status: Accepted

Solution code:
# coding:utf-8

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


N = int(input())
L = inpl()
L.sort()

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

if(len(L) != 2*N):
    print("wrong number !")
    exit()

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

print(x)

Submission status: Accepted

Solution code:
import numpy as np

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

if(len(L) != 2*N):
    print("wrong number !")
    exit()

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

print(x)

Submission status: Accepted

Solution code:
def main18():
    num = int(input(""));
    strbuf = input("");
    strbufs = strbuf.split();
    num2 = num*2
    buf = [];
    for i in range((num2)):
        buf.append(int(strbufs[i]));
    buf.sort();
    result = 0;
    for i in range(num):
        result += buf[2*i];
    print(result);


if __name__ == '__main__':
    main18()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
L=map(int,input().split())
L=sorted(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=input()
L=L.rstrip().split()
list1=[]
for i in range(2*N):
    list1.append(int(L[i]))
list1.sort()
#print(list1)
ans=0
for j in range(2*N):
    if j%2==0:
        ans+=list1[j]
        
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())

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

b.sort()

su = 0

for i in range(a):
  su += b[2*i]
print(su)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(result)

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 += l[i]
print(ans)

Submission status: Accepted

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

Ls.sort()

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    t = input().split(" ")
    a = [int(i) for i in t]

    a.sort()
    sum = 0
    for i in range(N):
        sum += a[2*i]

    print(sum)
main()

Submission status: Accepted

Solution code:
N = int(input())
l = [int(x) for x in input().split()]
l_s = sorted(l, reverse = True)

tot = 0

for i in range(0, N * 2, 2) :
    tot += min(l_s[i], l_s[i + 1])
    
print(tot)

Submission status: Accepted

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

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_sorted = sorted(l)
print(sum(l_sorted[::2]))

Submission status: Accepted

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

L.sort()

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

print(guz)

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 += 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(1, len(L), 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()
s = 0
for i in range(N):
	s += L[2 * i]

print(s)

Submission status: Accepted

Solution code:
N = int(input())
l = sorted(list(map(int, input().split()))).pop
sum = 0
for i in range(N):
  l()
  sum += l()
print(sum)

Submission status: Accepted

Solution code:
import sys
import heapq
sys.setrecursionlimit(10**8)


N = int(input())
L_li = list(map(int,input().split()))
L_li.sort()
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
Li = list(map(int, input().split()))
LiSorted = sorted(Li)
Sum = 0
for i in range(N):
    Sum += LiSorted[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 range(n):
    ans += l[2*i]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

L.sort()

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

print(total)

Submission status: Accepted

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

Submission status: Accepted

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

a = 0
for i in range(0,l_len,2):
    a = a + l[i]

print(a)

Submission status: Accepted

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

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(L)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

L.sort(reverse=True)
if len(L) % 2 == 1:
  L.pop()

ans = 0
for k in range(0,len(L),2):
  ans += min(L[k],L[k+1])
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
arr = list(map(int,input().split()))
arr.sort()
ans = [_ for num,_ in enumerate(arr) if num % 2 == 0]
print(sum(ans))

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

arr = map(int,raw_input().split())

arr.sort()

count = 0
for i in range(n):
	count += arr[i*2]

print count

Submission status: Accepted

Solution code:
# coding: utf-8

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

L.sort(reverse=True)

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

Submission status: Accepted

Solution code:
#--- define function ---#
def num_check(n, l):
    if 2 * n == len(l):
        return True
    else:
        return False

#--- main ---#
num = int(input())
l = input().split()
list = [int(i) for i in l]

if not num_check(num, list):
    print("Invalid numbers.")
    exit()

list.sort()

meet = 0
for i in range(num):
    num1 = int(list.pop(0))
    list.pop(0)
    meet += num1

print(meet)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter


def getinputdata():
    # 配列初期化
    array_result = []

    data = input()

    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            array_temp = []

            if (data != ""):

                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:

        return array_result


arr_data = getinputdata()

n = int(arr_data[0][0]) * 2

arr = [int(x) for x in arr_data[1]]
arr.sort(reverse=True)

mysum = 0

for v in range(1, n, 2):
    mysum += arr[v]

print(mysum)

Submission status: Accepted

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

Submission status: Accepted

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

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())
arr=[int(i) for i in input().split()]
arr.sort()
ans=0
for i in range(0,n*2,2):
  ans+=arr[i]
print(ans)

Submission status: Accepted

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

# AtCoder Grand Contest
# Problem A


if __name__ == '__main__':
    number = int(input())
    l = sorted(list(map(int, input().split())), reverse=True)
    count = 0

    for i in range(number):
        count += min(l[2 * i], l[2 * i + 1])

    print(count)

Submission status: Accepted

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

print(ans)

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:
#!/usr/bin/env python3

import sys, math, copy
# import fractions, itertools
# import numpy as np
# import scipy

HUGE = 2147483647
HUGEL = 9223372036854775807
ABC = "abcdefghijklmnopqrstuvwxyz"

def main():
    n = int(input())
    ln = list(map(int, input().split()))
    ln = sorted(ln)
    ln_shorter = ln[::2]
    print(sum(ln_shorter))

main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# [競プロ等におけるpython3の標準入力 - Qiita](https://qiita.com/zenrshon/items/c4f3849552348b3dbe67)

# 数値の数の読み込み
n = int(input())
# 数値読み込み
a = [int(i) for i in input().split()]
a.sort(reverse=True)
print(sum(a[1::2]))

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,2):
    ans += L[i]
print(ans)

Submission status: Accepted

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

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

    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

for i in range(n):
    cnt += min(l_s[2*i], l_s[2*i + 1])

print(cnt)

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(list(map(int, input().split())))

print(sum([L[2*i] for i in range(N)]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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=list(map(int,input().split()))
l.sort()
s=0
for i in range(2*n)[::2]:
  s+=l[i]
print(s)

Submission status: Accepted

Solution code:
# coding: utf-8

kusi=int(input())
lst=list(map(int,input().split()))
cnt=1
tabe=0

lst.sort()
lst.reverse()

for i in lst:
    if int(cnt%2)==0:
        tabe+=i
    cnt+=1

print(tabe)

Submission status: Accepted

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

L.sort()

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

print(cnt)

Submission status: Accepted

Solution code:
N = input()
line = list(map(int,input().split()))
line.sort()
o = 0
for i in range(int(len(line)/2)):
    o += line[2*i*1]

print(o)

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())
a=sorted(list(map(int,input().split())))
ans=0
for i in range(n):
    ans+=min(a[2*i],a[2*i+1])
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(sum([L[2*i] for i in range(N)]))

Submission status: Accepted

Solution code:
n = int(input())

l = [int(v) for v in input().split(' ')]

n_l = sorted(l)[::-1]

s = 0

for i in range(n):
    s += min(n_l[i*2], n_l[i*2+1])

print(s)

Submission status: Accepted

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

Submission status: Accepted

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

A.sort()
ans=0
for i in range(2*N):
  if i%2==0:
    ans+=A[i]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
src = list(map(int,input().split()))
src.sort()
ans = 0
for a,b in zip(src[::2],src[1::2]):
    ans += a
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
N = int(input())
L = list(map(int, input().split()))
L.sort()
print(sum((x for i, x in enumerate(L) if i % 2 == 0)))

Submission status: Accepted

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

array = []
for i in range(0, len(val)-1, 2):
    array.append(min(val[i], val[i+1]))
print(sum(array))

Submission status: Accepted

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

Ls_sorted = sorted(Ls, reverse=True)

print(sum(Ls_sorted[1::2]))

Submission status: Accepted

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

solve()

Submission status: Accepted

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

L.sort()
count = 0

while len(L) != 0:
    first = L.pop(0)
    second = L.pop(0)
    count += min(first,second)

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()*2
l = sorted(map(int, raw_input().split()))
print sum([l[i] for i in xrange(0, n, 2)])

Submission status: Accepted

Solution code:
n = input()
a = sorted(map(int, raw_input().split()))
print sum([a[2 * i] for i in xrange(n)])

Submission status: Accepted

Solution code:
input()
a = sorted(map(int, raw_input().split()), reverse = True)
print sum(a[1::2])

Submission status: Accepted

Solution code:
N = int(input())
L = sorted(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 = list(map(int, input().split()))
L.sort()
sum = 0
for i in range(N):
    x = L.pop(0)
    y = L.pop(0)
    sum += x
print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ret)

Submission status: Accepted

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

Submission status: Accepted

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

import sys
import os

n = int(sys.stdin.readline())
s = 0

lenlist = map(int, sys.stdin.readline().strip().split(" "))
lenlist.sort()
for i in range(0,n):
    m = min(lenlist[2*i],lenlist[2*i+1])
    s += m

print s

Submission status: Accepted

Solution code:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = 10 ** 10


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
L = sorted(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:
input()
L=[int(x) for x in input().split()]
L=sorted(L)
ans=0
for i,l in enumerate(L):
    if i%2==0:
        ans+=l
print(ans)

Submission status: Accepted

Solution code:
#! /bin/python
# coding:utf-8

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

L.sort()
L.reverse()

res = 0
for num in range(0, len(L)):
	if (num % 2 != 0):
		res = res + L[num]
print res

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
def f(xs, ys):
    acc = 0
    for x, y in zip(xs, ys):
        acc += min(x, y)
    return acc
n = int(input())
l = sorted(map(int,input().split()))
ans = max(f(l[0::2], l[1::2]), f(l[1::2], l[2::2]))
print(ans)

Submission status: Accepted

Solution code:
def bbq_easy():
	n = int(raw_input())
	l = map(int, raw_input().split(" "))
	sorted_l = sorted(l, reverse=True)
	print sum(sorted_l[1::2])


if __name__ == "__main__":
	bbq_easy()

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

N = int(raw_input())
L_list = map(int, raw_input().split(" "))

sorted_L = sorted(L_list)
ret = sum(sorted_L[0::2])
print ret

Submission status: Accepted

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

L = sorted(L)

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

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())
L = list(sorted(map(int, input().split())))
# N = 5
# L = sorted([100, 1, 2, 3, 14, 15, 58, 58, 58, 29])

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(raw_input())
a = sorted(map(int, raw_input().split()))
print sum(a[::2])

Submission status: Accepted

Solution code:
N = int(raw_input())
A = map(int, raw_input().split())
sum = 0
A.sort()
B = A[::2]
x = 0
for i in B:
    x = x + i
    pass
print x

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
a = map(int, raw_input().strip().split())
print(sum(sorted(a)[0:-1:2]))

Submission status: Accepted

Solution code:
n = int(raw_input())
a = map(int, raw_input().split())
a.sort()

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

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
N = int(input())
L = sorted(list(map(int, input().split())), reverse = True)
ans = 0
for tmp in range(0, len(L), 2):
    ans += min(L[tmp],L[tmp+1])
print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
N = int(input())
sticks = list(map(int, input().split()))
sticks.sort()

sum = 0
for num in range(N):
    sum += sticks[2 * num]

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

L.sort()
for i in xrange(len(L)/2):
    ans += L[i*2]
    
print ans

Submission status: Accepted

Solution code:
n = int(raw_input())
ls = map(int, raw_input().split())
ls.sort()
al = [j for i,j in enumerate(ls) if i % 2 == 0]
print sum(al)

Submission status: Accepted

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

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

print total

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(2*N) if not i % 2]))

Submission status: Accepted

Solution code:
import numpy as np
input();L=sorted(map(int,input().split()))[::-1]
print(sum([min(a,b) for a,b in np.array(L).reshape(-1,2)]))