node_ids listlengths 4 1.4k | edge_index listlengths 1 2.22k | text listlengths 4 1.4k | source stringlengths 14 427k |
|---|---|---|---|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
17,
2,
17,
13,
17,
0,
13,
18,
13,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13,
10,
18,
13,
10,
17,
13,
... | [
[
48,
2
],
[
57,
8
],
[
45,
20
],
[
58,
23
],
[
54,
25
],
[
29,
28
],
[
49,
34
],
[
51,
37
],
[
46,
39
],
[
58,
39
],
[
28,
40
],
[
52,
43
],
[
55,
43
],
[
... | [
"a = int(input())\nb = list(map(int,input().split()))\nb = sorted(b)\nc = 0\nfor i in range(0,2*a,2):\n c += b[i]\nprint(c)",
"a = int(input())",
"a",
"int(input())",
"int",
"input()",
"input",
"b = list(map(int,input().split()))",
"b",
"list(map(int,input().split()))",
"list",
"map(int,inp... | 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) |
[
7,
0,
13,
4,
13,
4,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
4,
18,
13,
13,
4,
13,
4,
13,
18,
13,
39,
17,
17,
10,
4,
13,
10,
13,
13
] | [
[
36,
2
],
[
10,
9
],
[
9,
18
],
[
39,
20
],
[
40,
24
],
[
40,
31
],
[
36,
37
],
[
39,
40
]
] | [
"N = int(input())\nL = [int(i) for i in input().split()]\n\nL.sort()\nprint(sum(L[0::2]))",
"N = int(input())",
"N",
"int(input())",
"int",
"input()",
"input",
"int(i) for i in input().split()",
"for i in input().split()",
"i",
"input().split()",
"().split",
"()",
"input",
"split",
"fo... | N = int(input())
L = [int(i) for i in input().split()]
L.sort()
print(sum(L[0::2])) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
17,
2,
17,
13,
17,
0,
13,
18,
13,
13,
4,
13,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13,
10,
18,
13
] | [
[
48,
2
],
[
45,
8
],
[
42,
22
],
[
26,
25
],
[
49,
31
],
[
51,
34
],
[
46,
36
],
[
25,
37
],
[
52,
40
],
[
43,
40
],
[
42,
43
],
[
45,
46
],
[
48,
49
],
[
... | [
"N=int(input())\nL=sorted(list(map(int,input().split())))\nans=0\nfor i in range(0,2*N,2):\n ans+=L[i]\nprint(ans)",
"N=int(input())",
"N",
"int(input())",
"int",
"input()",
"input",
"L=sorted(list(map(int,input().split())))",
"L",
"sorted(list(map(int,input().split())))",
"sorted",
"list(map... | 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)
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
18,
13,
39,
17,
4,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13,
10,
18,
13
] | [
[
35,
2
],
[
38,
8
],
[
39,
21
],
[
41,
24
],
[
39,
26
],
[
42,
33
],
[
39,
33
],
[
35,
36
],
[
38,
39
],
[
41,
42
]
] | [
"N = int(input())\nA = list(map(int, input().split()))\n\nA.sort()\nA = A[::2]\nprint(sum(A))",
"N = int(input())",
"N",
"int(input())",
"int",
"input()",
"input",
"A = list(map(int, input().split()))",
"A",
"list(map(int, input().split()))",
"list",
"map(int, input().split())",
"map",
"in... | N = int(input())
A = list(map(int, input().split()))
A.sort()
A = A[::2]
print(sum(A)) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
17,
28,
13,
4,
13,
13,
0,
13,
18,
13,
2,
17,
13,
4,
13,
13,
10,
4,
13,
10,
17,
13,
10,
4,
13,
10,
18,
13
] | [
[
42,
2
],
[
48,
8
],
[
49,
21
],
[
45,
24
],
[
28,
27
],
[
43,
30
],
[
51,
32
],
[
49,
34
],
[
27,
37
],
[
52,
40
],
[
46,
40
],
[
42,
43
],
[
45,
46
],
[
... | [
"N = int(input())\nL = list(map(int,input().split()))\nL.sort()\nout = 0\nfor i in range(N):\n out += L[2*i]\nprint(out)",
"N = int(input())",
"N",
"int(input())",
"int",
"input()",
"input",
"L = list(map(int,input().split()))",
"L",
"list(map(int,input().split()))",
"list",
"map(int,input(... | N = int(input())
L = list(map(int,input().split()))
L.sort()
out = 0
for i in range(N):
out += L[2*i]
print(out) |
[
7,
0,
13,
4,
13,
4,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
4,
13,
13,
0,
13,
12,
13,
23,
0,
13,
17,
28,
13,
4,
13,
17,
4,
13,
13,
17,
0,
13,
4,
13,
18,
13,
13,
18,
13,
2,
13,
17,
4,
13,
13,
... | [
[
60,
2
],
[
10,
9
],
[
9,
18
],
[
57,
20
],
[
26,
25
],
[
63,
30
],
[
34,
33
],
[
58,
39
],
[
66,
42
],
[
58,
46
],
[
33,
47
],
[
58,
49
],
[
33,
51
],
[
6... | [
"N=int(input()) \nL = sorted([int(i) for i in input().split()], key=lambda x: x)\n\nfoodCount = 0\nfor i in range(0,len(L), 2):\n foodCount += min(L[i], L[i+1])\n\nprint(foodCount)",
"N=int(input())",
"N",
"int(input())",
"int",
"input()",
"input",
"int(i) for i in input().split()",
"for i in inpu... | N=int(input())
L = sorted([int(i) for i in input().split()], key=lambda x: x)
foodCount = 0
for i in range(0,len(L), 2):
foodCount += min(L[i], L[i+1])
print(foodCount)
|
[
7,
0,
13,
4,
13,
4,
13,
4,
13,
4,
13,
18,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
39,
17,
10,
4,
13
] | [
[
25,
2
],
[
25,
26
]
] | [
"n=int(input())\nprint(sum(sorted(map(int,input().split()))[::2]))",
"n=int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"print(sum(sorted(map(int,input().split()))[::2]))",
"print",
"sum(sorted(map(int,input().split()))[::2])",
"sum",
"sorted(map(int,input().split()))[::2]",
"... | n=int(input())
print(sum(sorted(map(int,input().split()))[::2])) |
[
7,
12,
13,
0,
13,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
17,
2,
17,
13,
17,
0,
13,
4,
13,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
13,
29,
13,
23,
13,
23,
13,
0,
13,
4,
13,
4,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4... | [
[
5,
4
],
[
40,
7
],
[
10,
9
],
[
13,
12
],
[
38,
18
],
[
22,
21
],
[
4,
25
],
[
12,
26
],
[
4,
28
],
[
12,
30
],
[
34,
33
],
[
21,
34
],
[
33,
36
],
[
9,
... | [
"#1\ndef solution(n, skewers):\n sorted_s = sorted(skewers)\n answer = 0\n for i in range(0, 2*n, 2):\n smaller = min(sorted_s[i],sorted_s[i+1])\n answer += smaller\n return answer\n\nn = int(input())\nskewers = [int(x) for x in input().split()]\nprint(solution(n, skewers))",
"def solution(n, skewers):\... | #1
def solution(n, skewers):
sorted_s = sorted(skewers)
answer = 0
for i in range(0, 2*n, 2):
smaller = min(sorted_s[i],sorted_s[i+1])
answer += smaller
return answer
n = int(input())
skewers = [int(x) for x in input().split()]
print(solution(n, skewers)) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
17,
28,
13,
4,
13,
17,
2,
4,
13,
13,
17,
40,
17,
0,
13,
2,
13,
18,
13,
13,
4,
13,
13,
10,
4,
13,
10,
17,
13,
10,
2,
... | [
[
58,
2
],
[
49,
8
],
[
50,
21
],
[
52,
24
],
[
28,
27
],
[
50,
34
],
[
55,
39
],
[
53,
41
],
[
56,
41
],
[
50,
43
],
[
27,
44
],
[
56,
47
],
[
53,
47
],
[
... | [
"num_meals = int(input())\nskewers = list(map(int, input().split()))\nskewers.sort()\ningredients = 0\nfor skewer in range(0,(len(skewers) - 1),+2):\n ingredients = ingredients + skewers[skewer]\nprint(ingredients)",
"num_meals = int(input())",
"num_meals",
"int(input())",
"int",
"input()",
"input",
... | 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)
|
[
7,
0,
13,
4,
13,
41,
28,
13,
4,
18,
4,
13,
13,
17,
4,
4,
13,
13,
0,
13,
13,
4,
18,
13,
13,
41,
28,
13,
4,
13,
4,
13,
13,
2,
2,
13,
17,
17,
4,
18,
13,
13,
4,
13,
4,
13,
13,
10,
13,
13,
10,
4,
13
] | [
[
51,
2
],
[
8,
7
],
[
7,
17
],
[
48,
19
],
[
49,
23
],
[
28,
27
],
[
49,
32
],
[
27,
35
],
[
49,
40
],
[
27,
41
],
[
48,
49
],
[
51,
52
]
] | [
"N = input()\nL = [int(j) for j in input().split(' ')]\nL.sort()\nprint(sum([L[j] for j in range(len(L)) if j % 2 == 0]))",
"N = input()",
"N",
"input()",
"input",
"int(j) for j in input().split(' ')",
"for j in input().split(' ')",
"j",
"input().split(' ')",
"().split",
"()",
"input",
"spli... | N = input()
L = [int(j) for j in input().split(' ')]
L.sort()
print(sum([L[j] for j in range(len(L)) if j % 2 == 0]))
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
2,
17,
13,
14,
2,
2,
13,
17,
17,
9,
0,
13,
18,
13,
13,
4,
13,
13,
10,
4,
13,
10,
18,
13,
10,
17,
13,
10,
... | [
[
47,
2
],
[
56,
8
],
[
53,
22
],
[
26,
25
],
[
48,
30
],
[
25,
34
],
[
50,
39
],
[
57,
41
],
[
25,
42
],
[
51,
45
],
[
54,
45
],
[
47,
48
],
[
50,
51
],
[
... | [
"N = int(input())\nL = sorted(list(map(int,input().split())))\nans = 0\nfor i in range(2*N):\n if i % 2 == 1:\n continue\n else:\n ans += L[i]\nprint(ans)",
"N = int(input())",
"N",
"int(input())",
"int",
"input()",
"input",
"L = sorted(list(map(int,input().split())))",
"L",
"s... | 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)
|
[
7,
4,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
4,
18,
13,
13,
0,
13,
17,
4,
13,
4,
13,
18,
13,
39,
17,
17,
10,
13,
13
] | [
[
6,
5
],
[
5,
14
],
[
35,
16
],
[
36,
20
],
[
24,
23
],
[
36,
30
],
[
35,
36
]
] | [
"input()\nL=[int(l) for l in input().split()]\nL.sort(reverse=True)\nprint(sum(L[1::2]))",
"input()",
"input",
"int(l) for l in input().split()",
"for l in input().split()",
"l",
"input().split()",
"().split",
"()",
"input",
"split",
"for l in input().split()",
"int(l)",
"int",
"l",
"L... | input()
L=[int(l) for l in input().split()]
L.sort(reverse=True)
print(sum(L[1::2])) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
13,
0,
13,
17,
0,
13,
18,
13,
39,
17,
17,
4,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13,
10,
18,
13,
10,
4,
13
] | [
[
40,
2
],
[
49,
8
],
[
43,
20
],
[
50,
23
],
[
26,
25
],
[
46,
28
],
[
44,
30
],
[
50,
30
],
[
47,
38
],
[
40,
41
],
[
43,
44
],
[
46,
47
],
[
49,
50
]
] | [
"N = int(input())\nL = list(map(int, input().split()))\nL = sorted(L, reverse=True)\nmL = L[1::2]\nprint(sum(mL))",
"N = int(input())",
"N",
"int(input())",
"int",
"input()",
"input",
"L = list(map(int, input().split()))",
"L",
"list(map(int, input().split()))",
"list",
"map(int, input().split... | N = int(input())
L = list(map(int, input().split()))
L = sorted(L, reverse=True)
mL = L[1::2]
print(sum(mL)) |
[
7,
12,
13,
0,
13,
4,
13,
13,
4,
18,
4,
18,
4,
13,
17,
13,
13,
31,
13,
4,
18,
13,
13,
0,
13,
4,
13,
18,
13,
39,
17,
4,
13,
13,
14,
2,
13,
17,
4,
13,
10,
12,
13
] | [
[
5,
4
],
[
5,
17
],
[
25,
24
],
[
24,
33
],
[
42,
39
]
] | [
"# AGC001A - BBQ Easy\ndef main():\n N, *L = map(int, open(0).read().split())\n L.sort()\n ans = sum(L[::2])\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()",
"def main():\n N, *L = map(int, open(0).read().split())\n L.sort()\n ans = sum(L[::2])\n print(ans)",
"main",
"N, *L... | # AGC001A - BBQ Easy
def main():
N, *L = map(int, open(0).read().split())
L.sort()
ans = sum(L[::2])
print(ans)
if __name__ == "__main__":
main() |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
17,
28,
13,
4,
13,
4,
13,
13,
14,
2,
2,
13,
17,
17,
0,
13,
18,
13,
13,
4,
13,
13,
10,
4,
13,
10,
18,
13,
10,
4,
13,
... | [
[
54,
2
],
[
48,
8
],
[
49,
21
],
[
57,
24
],
[
28,
27
],
[
49,
32
],
[
27,
36
],
[
51,
40
],
[
49,
42
],
[
27,
43
],
[
52,
46
],
[
58,
46
],
[
48,
49
],
[
... | [
"n = int(input())\nl = list(map(int, input().split()))\nl.sort()\nsum = 0\n#print(l)\n\nfor i in range(len(l)):\n if i % 2 == 0:\n sum += l[i]\nprint(sum)",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"l = list(map(int, input().split()))",
"l",
"list(map(int, inpu... | n = int(input())
l = list(map(int, input().split()))
l.sort()
sum = 0
#print(l)
for i in range(len(l)):
if i % 2 == 0:
sum += l[i]
print(sum) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
17,
28,
13,
4,
13,
2,
17,
13,
14,
40,
2,
13,
17,
0,
13,
18,
13,
13,
4,
13,
13,
10,
4,
13,
10,
18,
13,
10,
4,
13,
10,
... | [
[
53,
2
],
[
47,
8
],
[
48,
21
],
[
56,
24
],
[
28,
27
],
[
54,
32
],
[
27,
36
],
[
50,
39
],
[
48,
41
],
[
27,
42
],
[
51,
45
],
[
57,
45
],
[
47,
48
],
[
... | [
"n = int(input())\na = list(map(int, input().split()))\n\na.sort()\nans = 0\nfor i in range(2*n):\n\tif not i&1:\n\t\tans += a[i]\n\nprint(ans)",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"a = list(map(int, input().split()))",
"a",
"list(map(int, input().split()))",
"li... | 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)
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
17,
0,
13,
17,
28,
13,
4,
13,
13,
0,
13,
18,
13,
2,
2,
17,
13,
17,
4,
13,
13,
10,
4,
13,
10,
4,
13,
10,
18,
13,
10,
... | [
[
47,
2
],
[
50,
8
],
[
51,
21
],
[
25,
24
],
[
56,
27
],
[
31,
30
],
[
48,
33
],
[
53,
35
],
[
51,
37
],
[
30,
41
],
[
54,
45
],
[
57,
45
],
[
47,
48
],
[
... | [
"n = int(input())\nls = list(map(int, input().split()))\n\nls.sort(reverse=True)\n\nans = 0\n\nfor i in range(n):\n ans += ls[2 * i + 1]\n\nprint(ans)",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"ls = list(map(int, input().split()))",
"ls",
"list(map(int, input().split... | n = int(input())
ls = list(map(int, input().split()))
ls.sort(reverse=True)
ans = 0
for i in range(n):
ans += ls[2 * i + 1]
print(ans) |
[
7,
15,
13,
0,
13,
18,
18,
13,
13,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
4,
13,
13,
4,
13,
13,
10,
4,
13,
10,
18,
13,
10,
4,
13,
10,
4,
13
] | [
[
44,
4
],
[
41,
11
],
[
45,
15
],
[
47,
17
],
[
45,
26
],
[
48,
30
],
[
50,
33
],
[
51,
39
],
[
41,
42
],
[
44,
45
],
[
47,
48
],
[
50,
51
]
] | [
"import sys\ninput = sys.stdin.readline\n\nn=int(input())\nvA=list(map(int,input().split()))\nvA.sort()\nres=sum(a for a in vA[::2])\n\nprint(res)",
"import sys",
"sys",
"input = sys.stdin.readline",
"input",
"sys.stdin.readline",
"sys.stdin",
"sys",
"stdin",
"readline",
"n=int(input())",
"n",... | import sys
input = sys.stdin.readline
n=int(input())
vA=list(map(int,input().split()))
vA.sort()
res=sum(a for a in vA[::2])
print(res)
|
[
7,
12,
13,
0,
13,
4,
13,
4,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
4,
13,
4,
13,
4,
13,
13,
0,
13,
17,
28,
13,
18,
13,
39,
17,
17,
0,
13,
13,
4,
13,
13,
4,
13,
10,
12,
13
] | [
[
5,
4
],
[
12,
11
],
[
11,
20
],
[
23,
22
],
[
32,
31
],
[
35,
34
],
[
22,
36
],
[
42,
41
],
[
34,
42
],
[
41,
45
],
[
31,
45
],
[
50,
47
]
] | [
"def resolve():\n N = int(input())\n L = list(reversed(sorted([int(i) for i in input().split()])))\n sumA = 0\n for l in L[1::2]:\n sumA += l\n print(sumA)\n\n\nresolve()",
"def resolve():\n N = int(input())\n L = list(reversed(sorted([int(i) for i in input().split()])))\n sumA = 0\... | def resolve():
N = int(input())
L = list(reversed(sorted([int(i) for i in input().split()])))
sumA = 0
for l in L[1::2]:
sumA += l
print(sumA)
resolve()
|
[
7,
0,
13,
4,
13,
4,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
4,
18,
13,
13,
4,
13,
4,
13,
18,
13,
39,
17,
17,
10,
4,
13,
10,
13,
13
] | [
[
36,
2
],
[
10,
9
],
[
9,
18
],
[
39,
20
],
[
40,
24
],
[
40,
31
],
[
36,
37
],
[
39,
40
]
] | [
"n = int(input())\na = [int(i) for i in input().split()]\na.sort()\nprint(sum(a[0::2]))",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"int(i) for i in input().split()",
"for i in input().split()",
"i",
"input().split()",
"().split",
"()",
"input",
"split",
"for ... | n = int(input())
a = [int(i) for i in input().split()]
a.sort()
print(sum(a[0::2])) |
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
42,
13,
14,
2,
18,
13,
17,
18,
13,
17,
0,
13,
18,
13,
17,
0,
13,
18,
13,
17,
0,
13,
18,
13,
17,
0,
13,
18,
13,
17,
14,
2,
4,
13,
13,
17... | [
[
126,
2
],
[
132,
6
],
[
114,
18
],
[
133,
25
],
[
133,
28
],
[
135,
31
],
[
133,
33
],
[
111,
36
],
[
133,
38
],
[
129,
41
],
[
133,
43
],
[
123,
46
],
[
133,
48
... | [
"N=input()\nL=list(map(int,input().split()))\n\nitems=0\n\nwhile(L):\n\n\tif L[0]<L[1] :\n\t\ts_lg=L[0]\n\t\tlg=L[1]\n\telse:\n\t\ts_lg=L[1]\n\t\tlg=L[0]\n\n\tif len(L)>2:\n\t\tfor i in range(2,len(L)) :\n\t\t\tif L[i]>=lg:\n\t\t\t\ts_lg=lg\n\t\t\t\tlg=L[i]\n\t\t\telif L[i]>=s_lg :\n\t\t\t\ts_lg=L[i]\n\n\titems=ite... | 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) |
[
7,
0,
13,
4,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
4,
18,
13,
13,
0,
13,
17,
28,
13,
4,
13,
4,
13,
13,
14,
2,
2,
13,
17,
17,
0,
13,
18,
13,
13,
4,
13,
13,
10,
13,
13,
10,
18,
13,
10,
4,... | [
[
55,
2
],
[
8,
7
],
[
7,
16
],
[
49,
18
],
[
50,
22
],
[
58,
25
],
[
29,
28
],
[
50,
33
],
[
28,
37
],
[
52,
41
],
[
50,
43
],
[
28,
44
],
[
53,
47
],
[
59... | [
"n = input()\nL = [int(_) for _ in input().split()]\nL.sort()\n\ntotal = 0\n\nfor i in range(len(L)):\n if i % 2 == 0:\n total += L[i]\n \nprint(total)",
"n = input()",
"n",
"input()",
"input",
"int(_) for _ in input().split()",
"for _ in input().split()",
"_",
"input().split()",
... | 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) |
[
7,
15,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
13,
13,
13,
0,
13,
2,
4,
13,
13,
17,
0,
13,
4,
13,
4,
13,
13,
4,
18,
13,
13,
0,
13,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
13,
0... | [
[
73,
4
],
[
79,
10
],
[
82,
14
],
[
74,
24
],
[
76,
26
],
[
74,
30
],
[
85,
33
],
[
80,
41
],
[
88,
44
],
[
86,
47
],
[
50,
49
],
[
53,
52
],
[
74,
55
],
[
... | [
"import numpy as np\nN =int(input())\ninput_line2 =(input())\nkushisashi_number = list(map(int,np.zeros(N)))\n\nno_kushi = int(N)*2\nkushi_length = list(map(int,input_line2.split()))\n\nkushisashi=sorted(kushi_length,reverse=True)\nfor n in range(N):\n kushisashi_number[n] = kushisashi[2*n+1]\n \nprint(sum(ku... | 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)) |
[
7,
12,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
18,
4,
13,
13,
13,
4,
13,
4,
13,
18,
13,
39,
17,
14,
2,
13,
17,
4,
13,
10,
12,
13
] | [
[
5,
4
],
[
11,
10
],
[
10,
29
],
[
40,
37
]
] | [
"# AGC001A - BBQ Easy\ndef main():\n n = int(input())\n L = sorted(map(int, input().rstrip().split()))\n print(sum(L[::2]))\n\n\nif __name__ == \"__main__\":\n main()",
"def main():\n n = int(input())\n L = sorted(map(int, input().rstrip().split()))\n print(sum(L[::2]))",
"main",
"n = int... | # AGC001A - BBQ Easy
def main():
n = int(input())
L = sorted(map(int, input().rstrip().split()))
print(sum(L[::2]))
if __name__ == "__main__":
main() |
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
17,
0,
13,
17,
0,
13,
17,
28,
13,
13,
14,
2,
2,
13,
17,
17,
0,
13,
18,
13,
13,
0,
13,
17,
4,
13,
13,
10,
17,
13,
10,
4,
13,
... | [
[
54,
2
],
[
63,
6
],
[
64,
19
],
[
23,
22
],
[
66,
25
],
[
51,
28
],
[
32,
31
],
[
64,
31
],
[
67,
36
],
[
58,
36
],
[
60,
40
],
[
64,
42
],
[
67,
43
],
[
... | [
"n = input()\nl = list(map(int, input().split()))\nl.sort(reverse=True)\nc = 0\nans = 0\nfor i in l: \n if c % 2 == 1:\n ans+=l[c]\n c+=1\nprint(ans)",
"n = input()",
"n",
"input()",
"input",
"l = list(map(int, input().split()))",
"l",
"list(map(int, input().split()))",
"list",
"map(i... | n = input()
l = list(map(int, input().split()))
l.sort(reverse=True)
c = 0
ans = 0
for i in l:
if c % 2 == 1:
ans+=l[c]
c+=1
print(ans) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
13,
0,
13,
18,
13,
2,
17,
13,
4,
13,
13,
10,
18,
13,
10,
4,
13,
10,
4,
13,
10,
17,
13
] | [
[
43,
2
],
[
46,
8
],
[
49,
22
],
[
26,
25
],
[
44,
28
],
[
40,
30
],
[
47,
32
],
[
25,
35
],
[
41,
38
],
[
50,
38
],
[
40,
41
],
[
43,
44
],
[
46,
47
],
[
... | [
"n = int(input())\nl = sorted(list(map(int, input().split())))\nans = 0\nfor i in range(n):\n ans += l[2 * i]\nprint(ans)",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"l = sorted(list(map(int, input().split())))",
"l",
"sorted(list(map(int, input().split())))",
"sorte... | n = int(input())
l = sorted(list(map(int, input().split())))
ans = 0
for i in range(n):
ans += l[2 * i]
print(ans) |
[
7,
17,
15,
13,
12,
13,
0,
13,
17,
42,
13,
0,
13,
4,
18,
13,
13,
0,
13,
4,
18,
13,
13,
0,
13,
4,
13,
13,
13,
29,
13,
23,
13,
23,
13,
12,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,... | [
[
8,
7
],
[
13,
12
],
[
34,
15
],
[
19,
18
],
[
34,
21
],
[
25,
24
],
[
12,
27
],
[
18,
28
],
[
24,
30
],
[
7,
30
],
[
32,
32
],
[
34,
34
],
[
39,
38
],
[
4... | [
"# -*- coding: utf-8 -*-\n\"\"\"\nA - BBQ Easy\nhttps://atcoder.jp/contests/agc001/tasks/agc001_a\n\n\"\"\"\nimport sys\n\n\ndef solve(N, L):\n ans = 0\n while L:\n a = L.pop()\n b = L.pop()\n ans += min(a, b)\n return ans\n\n\ndef main(args):\n N = int(input())\n L = sorted(map(... | # -*- 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:]) |
[
7,
15,
15,
13,
13,
13,
13,
13,
13,
13,
13,
4,
18,
13,
13,
2,
17,
17,
0,
13,
2,
2,
17,
17,
17,
12,
13,
12,
13,
12,
13,
12,
13,
23,
13,
0,
13,
4,
13,
0,
13,
4,
13,
4,
18,
13,
13,
0,
13,
17,
28,
13,
18,
4,
13,
... | [
[
69,
19
],
[
34,
34
],
[
84,
36
],
[
79,
38
],
[
87,
40
],
[
91,
42
],
[
88,
45
],
[
75,
48
],
[
52,
51
],
[
85,
57
],
[
72,
61
],
[
88,
63
],
[
51,
64
],
[
... | [
"from collections import Counter,defaultdict,deque\nimport sys,heapq,bisect,math,itertools,string,queue,fractions\nsys.setrecursionlimit(10**8)\nmod = 10**9+7\ndef inp(): return int(sys.stdin.readline())\ndef inpl(): return list(map(int, sys.stdin.readline().split()))\ndef inpl_str(): return list(sys.stdin.readline... | from collections import Counter,defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,fractions
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))
n = inp()
a = inpl()
a.sort()
res = 0
for i in range(2*n)[::2]:
res += a[i]
print(res)
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
17,
0,
13,
17,
28,
13,
4,
13,
13,
0,
13,
4,
13,
18,
13,
2,
17,
13,
18,
13,
2,
2,
17,
13,
17,
4,
13,
13,
10,
17,
13,
... | [
[
57,
2
],
[
63,
8
],
[
64,
21
],
[
25,
24
],
[
54,
27
],
[
31,
30
],
[
58,
33
],
[
60,
35
],
[
64,
39
],
[
30,
42
],
[
64,
44
],
[
30,
48
],
[
61,
52
],
[
... | [
"# coding: utf-8\n# Your code here!\nn=int(input())\nl=list(map(int,input().split()))\nl.sort(reverse=True)\nans=0\nfor i in range(n):\n ans+=min(l[2*i],l[2*i+1])\nprint(ans)",
"n=int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"l=list(map(int,input().split()))",
"l",
"list(map(i... | # coding: utf-8
# Your code here!
n=int(input())
l=list(map(int,input().split()))
l.sort(reverse=True)
ans=0
for i in range(n):
ans+=min(l[2*i],l[2*i+1])
print(ans)
|
[
7,
0,
13,
4,
13,
4,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
4,
18,
13,
13,
4,
13,
4,
13,
18,
13,
39,
17,
10,
13,
13,
10,
4,
13
] | [
[
38,
2
],
[
10,
9
],
[
9,
18
],
[
35,
20
],
[
36,
24
],
[
36,
31
],
[
35,
36
],
[
38,
39
]
] | [
"n = int(input())\nl = [int(x) for x in input().split()]\nl.sort()\nprint(sum(l[::2]))",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"int(x) for x in input().split()",
"for x in input().split()",
"x",
"input().split()",
"().split",
"()",
"input",
"split",
"for... | n = int(input())
l = [int(x) for x in input().split()]
l.sort()
print(sum(l[::2])) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
13,
0,
13,
17,
28,
13,
4,
13,
17,
2,
13,
17,
17,
0,
13,
2,
13,
18,
13,
13,
4,
13,
13,
10,
4,
13,
10,
17,
13,
10,
4,
13,
10,
... | [
[
53,
2
],
[
47,
8
],
[
48,
23
],
[
50,
25
],
[
29,
28
],
[
54,
33
],
[
56,
37
],
[
51,
39
],
[
57,
39
],
[
48,
41
],
[
28,
42
],
[
57,
45
],
[
51,
45
],
[
... | [
"n = int(input())\nl = list(map(int,input().split()))\nlist.sort(l)\ncount = 0\n\nfor i in range(0,n*2,2):\n count = count + l[i]\n\nprint(count)",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"l = list(map(int,input().split()))",
"l",
"list(map(int,input().split()))",
... | n = int(input())
l = list(map(int,input().split()))
list.sort(l)
count = 0
for i in range(0,n*2,2):
count = count + l[i]
print(count) |
[
7,
0,
13,
4,
13,
4,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
4,
18,
13,
13,
41,
28,
13,
4,
13,
4,
13,
13,
2,
2,
13,
17,
17,
4,
18,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13,
10,
13,
13
] | [
[
49,
2
],
[
10,
9
],
[
9,
18
],
[
52,
20
],
[
53,
24
],
[
29,
28
],
[
53,
33
],
[
28,
36
],
[
53,
41
],
[
28,
42
],
[
49,
50
],
[
52,
53
]
] | [
"n = int(input())\nl = [int(i) for i in input().split()]\nl.sort()\nprint(sum([l[i] for i in range(len(l)) if i%2 == 0]))",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"int(i) for i in input().split()",
"for i in input().split()",
"i",
"input().split()",
"().split",
"... | 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]))
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
17,
0,
13,
17,
28,
13,
4,
13,
4,
13,
13,
14,
40,
2,
13,
17,
17,
0,
13,
18,
13,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13,
... | [
[
51,
2
],
[
54,
8
],
[
55,
21
],
[
25,
24
],
[
60,
27
],
[
31,
30
],
[
55,
35
],
[
30,
39
],
[
57,
43
],
[
55,
45
],
[
30,
46
],
[
58,
49
],
[
61,
49
],
[
... | [
"N=int(input())\nL=list(map(int,input().split()))\nL.sort(reverse=True)\nx=0\nfor i in range(len(L)):\n if i%2!=0:\n x+=L[i]\nprint(x)",
"N=int(input())",
"N",
"int(input())",
"int",
"input()",
"input",
"L=list(map(int,input().split()))",
"L",
"list(map(int,input().split()))",
"list",
... | N=int(input())
L=list(map(int,input().split()))
L.sort(reverse=True)
x=0
for i in range(len(L)):
if i%2!=0:
x+=L[i]
print(x) |
[
7,
0,
13,
4,
13,
4,
13,
41,
28,
13,
4,
18,
4,
13,
13,
17,
4,
4,
13,
13,
0,
13,
13,
4,
18,
13,
13,
0,
13,
17,
0,
13,
17,
28,
13,
4,
13,
17,
2,
13,
17,
0,
13,
18,
13,
2,
2,
17,
13,
17,
4,
13,
13,
10,
13,
13,
... | [
[
63,
2
],
[
10,
9
],
[
9,
19
],
[
54,
21
],
[
55,
25
],
[
29,
28
],
[
57,
31
],
[
35,
34
],
[
64,
39
],
[
60,
42
],
[
55,
44
],
[
34,
48
],
[
61,
52
],
[
5... | [
"n = int(input())\nnum = [int(i) for i in input().split(' ')]\nnum.sort(reverse=True)\nm=0\nfor i in range(1,n+1):\n m+=num[2*i-1]\nprint(m)",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"int(i) for i in input().split(' ')",
"for i in input().split(' ')",
"i",
"input()... | n = int(input())
num = [int(i) for i in input().split(' ')]
num.sort(reverse=True)
m=0
for i in range(1,n+1):
m+=num[2*i-1]
print(m)
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
17,
4,
13,
4,
13,
18,
13,
39,
17,
17,
10,
4,
13,
10,
4,
13
] | [
[
39,
2
],
[
36,
8
],
[
37,
21
],
[
25,
24
],
[
37,
31
],
[
36,
37
],
[
39,
40
]
] | [
"N = int(input())\nL = list(map(int, input().split()))\n\nL.sort(reverse=True)\n\nprint(sum(L[1::2]))",
"N = int(input())",
"N",
"int(input())",
"int",
"input()",
"input",
"L = list(map(int, input().split()))",
"L",
"list(map(int, input().split()))",
"list",
"map(int, input().split())",
"map... | N = int(input())
L = list(map(int, input().split()))
L.sort(reverse=True)
print(sum(L[1::2])) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
17,
28,
13,
4,
13,
13,
0,
13,
4,
13,
18,
13,
2,
17,
13,
18,
13,
2,
2,
17,
13,
17,
4,
13,
13,
10,
17,
13,
10,
4,
13,
... | [
[
54,
2
],
[
60,
8
],
[
61,
21
],
[
51,
24
],
[
28,
27
],
[
55,
30
],
[
57,
32
],
[
61,
36
],
[
27,
39
],
[
61,
41
],
[
27,
45
],
[
58,
49
],
[
52,
49
],
[
... | [
"N = int(input())\nL = list(map(int, input().split()))\n\nL.sort()\n\ncount = 0\nfor i in range(N):\n count += min(L[2*i], L[2*i+1])\n\nprint(count)",
"N = int(input())",
"N",
"int(input())",
"int",
"input()",
"input",
"L = list(map(int, input().split()))",
"L",
"list(map(int, input().split()))... | N = int(input())
L = list(map(int, input().split()))
L.sort()
count = 0
for i in range(N):
count += min(L[2*i], L[2*i+1])
print(count) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
17,
28,
13,
4,
13,
13,
0,
13,
18,
13,
2,
17,
13,
4,
13,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13,
10,
18,
13
] | [
[
45,
2
],
[
48,
8
],
[
49,
21
],
[
42,
24
],
[
28,
27
],
[
46,
30
],
[
51,
32
],
[
49,
34
],
[
27,
37
],
[
52,
40
],
[
43,
40
],
[
42,
43
],
[
45,
46
],
[
... | [
"n = int(input())\nlis = list(map(int,input().split()))\nlis.sort()\nS = 0\nfor i in range(n):\n S += lis[2*i]\nprint(S)",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"lis = list(map(int,input().split()))",
"lis",
"list(map(int,input().split()))",
"list",
"map(int,in... | n = int(input())
lis = list(map(int,input().split()))
lis.sort()
S = 0
for i in range(n):
S += lis[2*i]
print(S)
|
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
12,
13,
0,
13,
17,
42,
13,
0,
13,
17,
28,
13,
4,
13,
2,
4,
13,
13,
17,
14,
2,
18,
13,
13,
18,
13,
2,
13,
17,
0,
18,
13,
13,
18,
13,
2,
13,
17,
18,... | [
[
101,
2
],
[
107,
6
],
[
21,
20
],
[
26,
25
],
[
29,
28
],
[
69,
34
],
[
47,
38
],
[
69,
39
],
[
28,
40
],
[
69,
42
],
[
28,
44
],
[
50,
47
],
[
69,
48
],
[
... | [
"n = input()\nl = list(map(int, input().split()))\ndef bubble_sort(arr):\n change = True\n while change:\n change = False\n for i in range(len(arr) - 1):\n if arr[i] > arr[i + 1]:\n arr[i], arr[i + 1] = arr[i + 1], arr[i]\n change = True\n return arr\n... | 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) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
17,
28,
13,
18,
13,
39,
17,
0,
13,
13,
4,
13,
13,
10,
4,
13,
10,
13,
13,
10,
17,
13,
10,
4,
13
] | [
[
48,
2
],
[
39,
8
],
[
40,
21
],
[
45,
24
],
[
28,
27
],
[
40,
29
],
[
42,
33
],
[
27,
34
],
[
43,
37
],
[
46,
37
],
[
39,
40
],
[
27,
42
],
[
42,
43
],
[
... | [
"n = int(input())\nl = list(map(int,input().split()))\nl.sort()\nans = 0\nfor i in l[::2]:\n ans +=i\nprint(ans)",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"l = list(map(int,input().split()))",
"l",
"list(map(int,input().split()))",
"list",
"map(int,input().split(... | n = int(input())
l = list(map(int,input().split()))
l.sort()
ans = 0
for i in l[::2]:
ans +=i
print(ans) |
[
7,
15,
13,
0,
13,
18,
18,
13,
13,
13,
12,
13,
0,
13,
4,
13,
4,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
4,
18,
13,
13,
4,
13,
4,
13,
18,
13,
39,
17,
14,
2,
13,
17,
4,
13,
10,
12,
13,
10,
1... | [
[
55,
4
],
[
14,
13
],
[
56,
17
],
[
21,
20
],
[
56,
24
],
[
20,
29
],
[
32,
31
],
[
31,
35
],
[
31,
42
],
[
53,
50
],
[
55,
56
]
] | [
"#!/usr/bin/env python3\n# -*- Coding: utf-8 -*-\n\nimport sys\n\n\ninput = sys.stdin.readline\n\n\ndef main():\n N = int(input())\n L = [int(i) for i in input().split()]\n L.sort()\n print(sum(L[::2]))\n\n\nif __name__ == '__main__':\n main()",
"import sys",
"sys",
"input = sys.stdin.readline"... | #!/usr/bin/env python3
# -*- Coding: utf-8 -*-
import sys
input = sys.stdin.readline
def main():
N = int(input())
L = [int(i) for i in input().split()]
L.sort()
print(sum(L[::2]))
if __name__ == '__main__':
main()
|
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
17,
28,
13,
4,
13,
4,
13,
13,
0,
13,
4,
13,
18,
13,
2,
17,
13,
18,
13,
2,
2,
17,
13,
17,
0,
13,
4,
13,
13,
4,
13,
13,
10,
... | [
[
65,
2
],
[
59,
6
],
[
60,
19
],
[
62,
22
],
[
26,
25
],
[
66,
30
],
[
68,
32
],
[
60,
36
],
[
25,
39
],
[
60,
41
],
[
25,
45
],
[
56,
48
],
[
69,
51
],
[
... | [
"wood = input()\n\nlis_1 = list(map(int,input().split()))\n\nlis_1.sort()\n\nguzai = 0\n\nfor i in range(int(wood)):\n max_gu = min(lis_1[2*i],lis_1[2*i+1])\n guzai += int(max_gu)\nprint(guzai)\n\n",
"wood = input()",
"wood",
"input()",
"input",
"lis_1 = list(map(int,input().split()))",
"lis_1",
"li... | 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)
|
[
7,
12,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
17,
2,
17,
13,
17,
0,
13,
18,
13,
13,
4,
13,
13,
4,
13,
10,
12,
13
] | [
[
5,
4
],
[
11,
10
],
[
25,
24
],
[
28,
27
],
[
4,
33
],
[
37,
36
],
[
10,
38
],
[
27,
39
],
[
36,
42
],
[
24,
42
],
[
47,
44
]
] | [
"def main():\n n = int(input())\n l = list(sorted(map(int, input().split())))\n ans = 0\n for i in range(0, 2*n, 2):\n ans += l[i]\n print(ans)\n\n\nmain()",
"def main():\n n = int(input())\n l = list(sorted(map(int, input().split())))\n ans = 0\n for i in range(0, 2*n, 2):\n ... | def main():
n = int(input())
l = list(sorted(map(int, input().split())))
ans = 0
for i in range(0, 2*n, 2):
ans += l[i]
print(ans)
main() |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
4,
13,
4,
13,
18,
13,
39,
17,
10,
4,
13,
10,
4,
13
] | [
[
32,
2
],
[
35,
8
],
[
36,
21
],
[
36,
28
],
[
32,
33
],
[
35,
36
]
] | [
"n=int(input())\nl = list(map(int, input().split()))\nl.sort()\nprint(sum(l[::2]))",
"n=int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"l = list(map(int, input().split()))",
"l",
"list(map(int, input().split()))",
"list",
"map(int, input().split())",
"map",
"int",
"input(... | n=int(input())
l = list(map(int, input().split()))
l.sort()
print(sum(l[::2])) |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
18,
4,
13,
17,
13,
13,
31,
13,
4,
18,
13,
13,
4,
13,
4,
13,
4,
13,
13,
13,
10,
4,
13
] | [
[
30,
2
],
[
30,
15
],
[
30,
31
]
] | [
"N,*L=map(int,open(0).read().split());L.sort();print(sum(min(a,b)for a,b in zip(L[::2],L[1::2])))",
"N,*L=map(int,open(0).read().split())",
"N",
"map(int,open(0).read().split())",
"map",
"int",
"open(0).read().split()",
"(0).read().split",
"(0).read()",
"(0).read",
"(0)",
"open",
"0",
"rea... | N,*L=map(int,open(0).read().split());L.sort();print(sum(min(a,b)for a,b in zip(L[::2],L[1::2]))) |
[
7,
15,
13,
0,
13,
4,
13,
0,
13,
4,
18,
4,
13,
13,
41,
28,
13,
13,
4,
4,
13,
13,
0,
13,
13,
4,
18,
13,
13,
4,
13,
4,
13,
18,
13,
39,
17,
17,
10,
4,
13,
10,
13,
13,
10,
4,
13
] | [
[
45,
4
],
[
39,
8
],
[
17,
16
],
[
40,
16
],
[
16,
21
],
[
42,
23
],
[
43,
27
],
[
43,
34
],
[
39,
40
],
[
42,
43
],
[
45,
46
]
] | [
"import numpy as np\na = input()\nc = input().split()\n\nd = [int(i) for i in c]\nd.sort()\n\nprint(sum(d[0::2]))",
"import numpy as np",
"numpy",
"a = input()",
"a",
"input()",
"input",
"c = input().split()",
"c",
"input().split()",
"().split",
"()",
"input",
"split",
"int(i) for i in c... | import numpy as np
a = input()
c = input().split()
d = [int(i) for i in c]
d.sort()
print(sum(d[0::2])) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
17,
0,
13,
17,
28,
13,
4,
13,
17,
2,
17,
13,
17,
0,
13,
4,
13,
18,
13,
13,
18,
13,
2,
13,
17,
4,
13,
13,
10,
4,
13,
... | [
[
54,
2
],
[
60,
8
],
[
61,
21
],
[
25,
24
],
[
57,
27
],
[
31,
30
],
[
55,
36
],
[
63,
39
],
[
61,
43
],
[
30,
44
],
[
61,
46
],
[
30,
48
],
[
64,
52
],
[
... | [
"N = int(input())\nL = list(map(int, input().split()))\nL.sort(reverse=True)\n\nans = 0\nfor i in range(0, 2 * N, 2):\n ans += min(L[i], L[i + 1])\n\nprint(ans)",
"N = int(input())",
"N",
"int(input())",
"int",
"input()",
"input",
"L = list(map(int, input().split()))",
"L",
"list(map(int, input... | N = int(input())
L = list(map(int, input().split()))
L.sort(reverse=True)
ans = 0
for i in range(0, 2 * N, 2):
ans += min(L[i], L[i + 1])
print(ans)
|
[
7,
14,
2,
13,
17,
0,
13,
4,
13,
4,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
4,
18,
13,
13,
0,
13,
17,
28,
13,
4,
13,
13,
0,
13,
4,
13,
18,
13,
2,
13,
17,
18,
13,
2,
2,
13,
17,
17,
4,
13,
... | [
[
67,
6
],
[
14,
13
],
[
13,
22
],
[
58,
24
],
[
59,
28
],
[
64,
31
],
[
35,
34
],
[
68,
37
],
[
61,
39
],
[
59,
43
],
[
34,
45
],
[
59,
48
],
[
34,
51
],
[
... | [
"if __name__ == '__main__':\n n =int(input())\n a = [int(i) for i in input().split()]\n a.sort()\n count =0\n\n for i in range(n):\n count+=min(a[i*2],a[i*2+1])\n print(count)",
"if __name__ == '__main__':\n n =int(input())\n a = [int(i) for i in input().split()]\n a.sort()\n ... | if __name__ == '__main__':
n =int(input())
a = [int(i) for i in input().split()]
a.sort()
count =0
for i in range(n):
count+=min(a[i*2],a[i*2+1])
print(count) |
[
7,
15,
13,
12,
13,
12,
13,
12,
13,
12,
13,
0,
13,
4,
13,
0,
13,
4,
13,
4,
18,
13,
13,
0,
13,
17,
28,
13,
4,
13,
13,
0,
13,
4,
13,
18,
13,
2,
17,
13,
18,
13,
2,
2,
17,
13,
17,
4,
13,
13,
29,
14,
2,
13,
17,
4... | [
[
13,
12
],
[
68,
14
],
[
17,
16
],
[
59,
18
],
[
16,
21
],
[
25,
24
],
[
28,
27
],
[
12,
30
],
[
33,
32
],
[
16,
36
],
[
27,
39
],
[
16,
41
],
[
27,
45
],
[
... | [
"#!/usr/bin/env python3\nimport sys\n# input = sys.stdin.readline\ndef INT(): return int(input())\ndef MAP(): return map(int,input().split())\ndef LI(): return list(map(int,input().split()))\n\ndef main():\n N = INT()\n L = LI()\n L.sort()\n answer = 0\n for i in range(N):\n answer += min(L[2*... | #!/usr/bin/env python3
import sys
# input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def main():
N = INT()
L = LI()
L.sort()
answer = 0
for i in range(N):
answer += min(L[2*i],L[2*i+1])
print(answer)
return
if __name__ == '__main__':
main()
|
[
7,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
41,
28,
13,
13,
4,
13,
13,
2,
2,
13,
17,
17,
4,
13,
4,
13,
4,
13,
13,
10,
4,
13
] | [
[
39,
4
],
[
40,
17
],
[
40,
25
],
[
39,
40
]
] | [
"input()\nl = list(map(int, input().split()))\nl.sort()\nprint(sum([v for i, v in enumerate(l) if i % 2 == 0]))",
"input()",
"input",
"l = list(map(int, input().split()))",
"l",
"list(map(int, input().split()))",
"list",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",... | input()
l = list(map(int, input().split()))
l.sort()
print(sum([v for i, v in enumerate(l) if i % 2 == 0])) |
[
7,
15,
13,
12,
13,
12,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
4,
13,
0,
13,
17,
0,
13,
17,
0,
13,
17,
42,
2,
13,
2,
17,
13,
0,
13,
4,
13,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
17,
4,
13,
13,
10,
4,
... | [
[
55,
8
],
[
71,
12
],
[
67,
14
],
[
65,
20
],
[
23,
22
],
[
58,
25
],
[
76,
28
],
[
59,
32
],
[
74,
32
],
[
56,
35
],
[
61,
37
],
[
68,
41
],
[
59,
42
],
[
... | [
"###template###\nimport sys\ndef input(): return sys.stdin.readline().rstrip()\ndef mi(): return map(int, input().split())\n###template###\n\nN = int(input())\nKs = sorted(list(mi()), reverse=True)\n\ni = 0\nans = 0\nwhile i < (2*N):\n ans += min(Ks[i],Ks[i+1])\n i += 2\n\nprint(ans)\n",
"import sys",
"sys",
... | ###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)
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
41,
28,
13,
4,
13,
2,
13,
17,
2,
2,
13,
17,
17,
4,
18,
13,
13,
0,
13,
4,
13,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13,
10,
4,
1... | [
[
49,
2
],
[
55,
8
],
[
56,
21
],
[
26,
25
],
[
50,
29
],
[
25,
33
],
[
56,
38
],
[
25,
39
],
[
52,
41
],
[
53,
47
],
[
49,
50
],
[
52,
53
],
[
55,
56
]
] | [
"N = int(input())\nL = list(map(int, input().split()))\nL.sort()\nans = sum([L[i] for i in range(N*2) if i % 2 == 0])\nprint(ans)",
"N = int(input())",
"N",
"int(input())",
"int",
"input()",
"input",
"L = list(map(int, input().split()))",
"L",
"list(map(int, input().split()))",
"list",
"map(in... | N = int(input())
L = list(map(int, input().split()))
L.sort()
ans = sum([L[i] for i in range(N*2) if i % 2 == 0])
print(ans)
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
13,
0,
13,
39,
28,
13,
4,
13,
2,
17,
13,
14,
2,
2,
13,
17,
17,
4,
18,
13,
13,
18,
13,
13,
0,
13,
4,
13,
13,
4,
13,
13,
10,
... | [
[
59,
2
],
[
56,
8
],
[
68,
20
],
[
57,
23
],
[
65,
25
],
[
29,
28
],
[
60,
33
],
[
28,
37
],
[
66,
42
],
[
69,
45
],
[
28,
46
],
[
62,
48
],
[
66,
51
],
[
... | [
"n = int(input())\nli = list(map(int, input().split()))\n\nl = sorted(li)\nlis = []\nfor i in range(2*n):\n if (i%2 == 0):\n lis.append(l[i])\n\na = sum(lis)\nprint(a)",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"li = list(map(int, input().split()))",
"li",
"lis... | n = int(input())
li = list(map(int, input().split()))
l = sorted(li)
lis = []
for i in range(2*n):
if (i%2 == 0):
lis.append(l[i])
a = sum(lis)
print(a) |
[
7,
0,
13,
4,
13,
4,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
4,
18,
13,
13,
41,
28,
13,
4,
13,
17,
2,
17,
13,
17,
4,
18,
13,
13,
4,
13,
4,
13,
13,
10,
13,
13,
10,
4,
13
] | [
[
49,
2
],
[
10,
9
],
[
9,
18
],
[
46,
20
],
[
47,
24
],
[
29,
28
],
[
50,
34
],
[
47,
38
],
[
28,
39
],
[
46,
47
],
[
49,
50
]
] | [
"n=int(input())\na=[int(i) for i in input().split()]\na.sort()\nprint(sum([a[i] for i in range(0,2*n,2)]))",
"n=int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"int(i) for i in input().split()",
"for i in input().split()",
"i",
"input().split()",
"().split",
"()",
"input",
... | n=int(input())
a=[int(i) for i in input().split()]
a.sort()
print(sum([a[i] for i in range(0,2*n,2)])) |
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
13,
4,
18,
4,
13,
13,
17,
4,
18,
13,
13,
13,
4,
13,
18,
13,
13,
10,
4,
13,
10,
4,
13
] | [
[
27,
2
],
[
30,
6
],
[
31,
18
],
[
31,
24
],
[
27,
28
],
[
30,
31
]
] | [
"N = input()\nLs = map(int,raw_input().split(\" \"))\n\nLs.sort()\nprint sum(Ls[i] for i in range(0,N*2,2))",
"N = input()",
"N",
"input()",
"input",
"Ls = map(int,raw_input().split(\" \"))",
"Ls",
"map(int,raw_input().split(\" \"))",
"map",
"int",
"raw_input().split(\" \")",
"().split",
"()... | N = input()
Ls = map(int,raw_input().split(" "))
Ls.sort()
print sum(Ls[i] for i in range(0,N*2,2)) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
0,
13,
17,
0,
13,
17,
28,
13,
4,
13,
17,
4,
13,
13,
17,
14,
2,
13,
13,
3,
0,
13,
4,
13,
18,
13,
13,
18,
13,
2,
13,
17,
... | [
[
78,
2
],
[
72,
8
],
[
23,
22
],
[
69,
25
],
[
75,
28
],
[
32,
31
],
[
73,
37
],
[
76,
41
],
[
67,
41
],
[
79,
42
],
[
63,
45
],
[
73,
49
],
[
31,
50
],
[
... | [
"n=int(input())\na=sorted(list(map(int,input().split())),reverse=True)\nans=0\nc=0\nfor i in range(0,len(a),2):\n if c>n:\n break\n #print(a[i],a[i+1],min(a[i],a[i+1]))\n ans+=min(a[i],a[i+1])\n c+=1\nprint(ans)",
"n=int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"a=... | n=int(input())
a=sorted(list(map(int,input().split())),reverse=True)
ans=0
c=0
for i in range(0,len(a),2):
if c>n:
break
#print(a[i],a[i+1],min(a[i],a[i+1]))
ans+=min(a[i],a[i+1])
c+=1
print(ans)
|
[
7,
0,
13,
4,
13,
4,
13,
4,
13,
18,
4,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
39,
17,
10,
4,
13
] | [
[
25,
2
],
[
25,
26
]
] | [
"_=input()\nprint(sum(sorted(list(map(int,input().split())))[::2]))",
"_=input()",
"_",
"input()",
"input",
"print(sum(sorted(list(map(int,input().split())))[::2]))",
"print",
"sum(sorted(list(map(int,input().split())))[::2])",
"sum",
"sorted(list(map(int,input().split())))[::2]",
"(list(map(int... | _=input()
print(sum(sorted(list(map(int,input().split())))[::2])) |
[
7,
0,
13,
4,
13,
4,
13,
4,
13,
4,
13,
13,
10,
4,
13
] | [
[
13,
2
],
[
13,
14
]
] | [
"N = int(input())\nprint(sum(l for l in sorted(list(map(int,input().split())),reverse=True)[1::2]))",
"N = int(input())",
"N",
"int(input())",
"int",
"input()",
"input",
"print(sum(l for l in sorted(list(map(int,input().split())),reverse=True)[1::2]))",
"print",
"sum(l for l in sorted(list(map(int... | N = int(input())
print(sum(l for l in sorted(list(map(int,input().split())),reverse=True)[1::2])) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
17,
28,
13,
4,
13,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13,
10,
17,
13
] | [
[
38,
2
],
[
35,
8
],
[
36,
21
],
[
41,
24
],
[
28,
27
],
[
39,
30
],
[
42,
33
],
[
35,
36
],
[
38,
39
],
[
41,
42
]
] | [
"n = int(input()); a = list(map(int, input().split()))\na.sort(); b = 0\nfor i in range(n): b += a[2*i]\nprint(b)",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"a = list(map(int, input().split()))",
"a",
"list(map(int, input().split()))",
"list",
"map(int, input().split... | n = int(input()); a = list(map(int, input().split()))
a.sort(); b = 0
for i in range(n): b += a[2*i]
print(b) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
41,
28,
13,
13,
4,
13,
13,
2,
2,
13,
17,
17,
4,
13,
0,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13,
10,
13,
13,
10,
4,
13
] | [
[
52,
2
],
[
46,
8
],
[
47,
21
],
[
47,
29
],
[
49,
38
],
[
50,
44
],
[
46,
47
],
[
49,
50
],
[
52,
53
]
] | [
"n = int(input())\nl = list(map(int,input().split()))\nl.sort()\nans = [j for i,j in enumerate(l) if i%2 == 0]\nprint(sum(ans))",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"l = list(map(int,input().split()))",
"l",
"list(map(int,input().split()))",
"list",
"map(int,in... | n = int(input())
l = list(map(int,input().split()))
l.sort()
ans = [j for i,j in enumerate(l) if i%2 == 0]
print(sum(ans))
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
39,
28,
13,
4,
13,
2,
17,
13,
14,
2,
2,
13,
17,
17,
4,
18,
13,
13,
18,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13,
10,
4,
... | [
[
52,
2
],
[
55,
8
],
[
56,
21
],
[
58,
24
],
[
28,
27
],
[
53,
32
],
[
27,
36
],
[
59,
41
],
[
56,
44
],
[
27,
45
],
[
59,
50
],
[
52,
53
],
[
55,
56
],
[
... | [
"n = int(input())\nli = list(map(int, input().split()))\n\nli.sort()\nli1 = []\n\nfor i in range(2*n):\n if i%2==0:\n li1.append(li[i])\nprint(sum(li1))",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"li = list(map(int, input().split()))",
"li",
"list(map(int, inpu... | n = int(input())
li = list(map(int, input().split()))
li.sort()
li1 = []
for i in range(2*n):
if i%2==0:
li1.append(li[i])
print(sum(li1)) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
17,
28,
13,
4,
13,
4,
13,
13,
14,
2,
2,
13,
17,
17,
0,
13,
2,
13,
18,
13,
13,
4,
13,
13,
10,
17,
13,
10,
2,
13,
10,
... | [
[
56,
2
],
[
59,
8
],
[
60,
21
],
[
50,
24
],
[
28,
27
],
[
60,
32
],
[
27,
36
],
[
53,
40
],
[
51,
42
],
[
54,
42
],
[
60,
44
],
[
27,
45
],
[
54,
48
],
[
... | [
"k = int(input())\nli= list(map(int, input().split()))\nli.sort()\nsum=0\nfor k in range(len(li)):\n \n if k%2==0:\n \n sum=sum+li[k]\n \nprint(sum)",
"k = int(input())",
"k",
"int(input())",
"int",
"input()",
"input",
"li= list(map(int, input().split()))",
"li",
"list(map(int, input().spli... | k = int(input())
li= list(map(int, input().split()))
li.sort()
sum=0
for k in range(len(li)):
if k%2==0:
sum=sum+li[k]
print(sum)
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
17,
28,
13,
4,
13,
17,
2,
2,
17,
13,
17,
17,
0,
13,
18,
13,
2,
13,
17,
4,
13,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13,
... | [
[
51,
2
],
[
54,
8
],
[
55,
21
],
[
48,
24
],
[
28,
27
],
[
52,
34
],
[
57,
38
],
[
55,
40
],
[
27,
42
],
[
58,
46
],
[
49,
46
],
[
48,
49
],
[
51,
52
],
[
... | [
"N = int(input())\nL = list(map(int, input().split()))\nL.sort()\nS = 0\nfor i in range (1, 2*N+1, 2):\n S += L[i-1]\nprint(S)",
"N = int(input())",
"N",
"int(input())",
"int",
"input()",
"input",
"L = list(map(int, input().split()))",
"L",
"list(map(int, input().split()))",
"list",
"map(int,... | N = int(input())
L = list(map(int, input().split()))
L.sort()
S = 0
for i in range (1, 2*N+1, 2):
S += L[i-1]
print(S) |
[
7,
12,
13,
15,
13,
0,
13,
18,
18,
13,
13,
13,
0,
13,
4,
13,
4,
18,
4,
13,
13,
17,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
18,
4,
13,
13,
17,
13,
4,
18,
13,
13,
0,
13,
17,
28,
13,
4,
13,
17,
2,
13,
17,
17,
0,
13,... | [
[
7,
6
],
[
14,
13
],
[
6,
19
],
[
24,
23
],
[
6,
34
],
[
23,
40
],
[
44,
43
],
[
47,
46
],
[
13,
51
],
[
56,
55
],
[
23,
59
],
[
46,
60
],
[
23,
62
],
[
46... | [
"def slove():\n import sys\n input = sys.stdin.readline\n n = int(input().rstrip('\\n'))\n l = list(map(int, input().rstrip('\\n').split()))\n l.sort()\n cnt = 0\n for i in range(0, n * 2, 2):\n cnt += min(l[i], l[i+1])\n print(cnt)\n\n\nif __name__ == '__main__':\n slove()",
"de... | def slove():
import sys
input = sys.stdin.readline
n = int(input().rstrip('\n'))
l = list(map(int, input().rstrip('\n').split()))
l.sort()
cnt = 0
for i in range(0, n * 2, 2):
cnt += min(l[i], l[i+1])
print(cnt)
if __name__ == '__main__':
slove()
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
13,
41,
28,
13,
4,
13,
13,
4,
18,
13,
2,
17,
13,
4,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] | [
[
42,
2
],
[
45,
8
],
[
48,
20
],
[
46,
23
],
[
27,
26
],
[
43,
29
],
[
49,
32
],
[
46,
32
],
[
26,
35
],
[
42,
43
],
[
45,
46
],
[
48,
49
]
] | [
"n=int(input())\nl=list(map(int,input().split()))\nl=sorted(l)\nprint(sum([l[2*i] for i in range(n)]))",
"n=int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"l=list(map(int,input().split()))",
"l",
"list(map(int,input().split()))",
"list",
"map(int,input().split())",
"map",
"... | n=int(input())
l=list(map(int,input().split()))
l=sorted(l)
print(sum([l[2*i] for i in range(n)])) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
18,
4,
13,
13,
0,
13,
39,
0,
13,
17,
28,
13,
13,
4,
18,
13,
13,
4,
13,
13,
42,
40,
13,
39,
4,
18,
13,
13,
4,
13,
13,
0,
13,
4,
13,
13,
4,
18,
13,
13,
4,
13,
13,
4,
13,
13,
... | [
[
69,
2
],
[
66,
8
],
[
63,
15
],
[
57,
18
],
[
22,
21
],
[
67,
21
],
[
64,
25
],
[
21,
29
],
[
64,
32
],
[
64,
36
],
[
64,
40
],
[
60,
42
],
[
64,
45
],
[
... | [
"a = int(input())\ns = input().split()\nd = []\nm = 0\nfor i in s:\n d.append(int(i))\nwhile d != []:\n d.remove(max(d))\n m += max(d)\n d.remove(max(d))\nprint(m)",
"a = int(input())",
"a",
"int(input())",
"int",
"input()",
"input",
"s = input().split()",
"s",
"input().split()",
"()... | a = int(input())
s = input().split()
d = []
m = 0
for i in s:
d.append(int(i))
while d != []:
d.remove(max(d))
m += max(d)
d.remove(max(d))
print(m)
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
4,
13,
13,
14,
2,
2,
13,
17,
17,
0,
13,
18,
13,
13,
4,
13,
13,
10,
18,
13,
10,
17,
13,
10,
4,
... | [
[
55,
2
],
[
58,
8
],
[
61,
20
],
[
59,
23
],
[
52,
25
],
[
29,
28
],
[
62,
33
],
[
59,
33
],
[
28,
37
],
[
49,
41
],
[
62,
43
],
[
59,
43
],
[
28,
44
],
[
... | [
"n = int(input())\nl = list(map(int,input().split()))\nl = sorted(l)\nans = 0\nfor i in range(len(l)):\n if i%2==0:\n ans += l[i]\nprint(ans)",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"l = list(map(int,input().split()))",
"l",
"list(map(int,input().split()))",... | 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)
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
17,
2,
17,
13,
17,
0,
13,
18,
13,
13,
4,
13,
13,
10,
4,
13,
10,
17,
13,
10,
18,
13,
10,
4,
13
] | [
[
42,
2
],
[
51,
8
],
[
45,
22
],
[
26,
25
],
[
43,
31
],
[
48,
34
],
[
52,
36
],
[
25,
37
],
[
49,
40
],
[
46,
40
],
[
42,
43
],
[
45,
46
],
[
48,
49
],
[
... | [
"n = int(input())\nl = sorted(list(map(int,input().split())))\nans = 0\nfor i in range(0,2*n,2):\n ans += l[i]\nprint(ans)",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"l = sorted(list(map(int,input().split())))",
"l",
"sorted(list(map(int,input().split())))",
"sorted... | 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) |
[
7,
15,
13,
0,
13,
18,
18,
13,
13,
13,
12,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
4,
13,
18,
13,
13,
4,
13,
13,
14,
2,
13,
17,
4,
13,
10,
18,
13,
10,
12,
13... | [
[
51,
4
],
[
14,
13
],
[
52,
17
],
[
20,
19
],
[
52,
28
],
[
19,
32
],
[
36,
35
],
[
19,
39
],
[
35,
43
],
[
55,
49
],
[
51,
52
]
] | [
"import sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n N = int(input())\n L = list(map(int, input().split()))\n\n L.sort()\n ans = sum(L[i] for i in range(0, 2 * N, 2))\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()",
"import sys",
"sys",
"input = sys.stdin.readline",
"inp... | import sys
input = sys.stdin.readline
def main():
N = int(input())
L = list(map(int, input().split()))
L.sort()
ans = sum(L[i] for i in range(0, 2 * N, 2))
print(ans)
if __name__ == "__main__":
main()
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
17,
28,
13,
4,
13,
13,
0,
13,
18,
13,
2,
17,
13,
4,
13,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13,
10,
18,
13
] | [
[
48,
2
],
[
45,
8
],
[
46,
21
],
[
42,
24
],
[
28,
27
],
[
49,
30
],
[
51,
32
],
[
46,
34
],
[
27,
37
],
[
52,
40
],
[
43,
40
],
[
42,
43
],
[
45,
46
],
[
... | [
"n=int(input())\nl=list(map(int,input().split()))\nl.sort()\nans=0\nfor _ in range(n):\n ans+=l[2*_]\nprint(ans)",
"n=int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"l=list(map(int,input().split()))",
"l",
"list(map(int,input().split()))",
"list",
"map(int,input().split())",
... | n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
for _ in range(n):
ans+=l[2*_]
print(ans) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
13,
4,
13,
18,
13,
39,
17,
17,
10,
4,
13,
10,
4,
13
] | [
[
29,
2
],
[
32,
8
],
[
33,
24
],
[
29,
30
],
[
32,
33
]
] | [
"a = int(input())\nb = sorted(map(int,input().split()))\nprint(sum(b[0::2]))",
"a = int(input())",
"a",
"int(input())",
"int",
"input()",
"input",
"b = sorted(map(int,input().split()))",
"b",
"sorted(map(int,input().split()))",
"sorted",
"map(int,input().split())",
"map",
"int",
"input()... | a = int(input())
b = sorted(map(int,input().split()))
print(sum(b[0::2])) |
[
7,
12,
13,
15,
13,
0,
13,
18,
18,
13,
13,
13,
4,
18,
13,
13,
2,
17,
17,
15,
15,
15,
15,
15,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
4,
18,
13,
13,
28,
13,
4,
13,
17,
2... | [
[
7,
6
],
[
27,
26
],
[
6,
30
],
[
33,
32
],
[
6,
41
],
[
45,
44
],
[
32,
48
],
[
52,
51
],
[
26,
57
],
[
61,
60
],
[
32,
62
],
[
51,
63
],
[
60,
66
],
[
44... | [
"def main():\n import sys\n input = sys.stdin.readline\n sys.setrecursionlimit(10**7)\n from collections import Counter, deque\n from itertools import combinations, permutations, accumulate, groupby, product\n from bisect import bisect_left,bisect_right\n from heapq import heapify, heappop, hea... | def main():
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
import math
#from math import gcd
#inf = 10**17
#mod = 10**9 + 7
n = int(input())
l = list(map(int, input().split()))
res = 0
l.sort()
for i in range(0, 2*n, 2):
res += l[i]
print(res)
if __name__ == '__main__':
main() |
[
7,
15,
13,
15,
13,
0,
13,
18,
18,
18,
13,
13,
13,
13,
0,
13,
18,
18,
18,
13,
13,
13,
13,
0,
13,
18,
18,
18,
13,
13,
13,
13,
0,
13,
18,
4,
18,
13,
13,
4,
18,
4,
13,
13,
18,
13,
13,
39,
17,
4,
18,
13,
13,
0,
13... | [
[
78,
6
],
[
66,
15
],
[
75,
24
],
[
69,
33
],
[
79,
42
],
[
70,
51
],
[
72,
54
],
[
70,
58
],
[
73,
64
],
[
66,
67
],
[
69,
70
],
[
72,
73
],
[
75,
76
],
[
... | [
"import sys\nimport numpy as np\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nL = np.array(read().split(), np.int32)[1:]\n\nL.sort()\nx = L[::2].sum()\nprint(x)",
"import sys",
"sys",
"import numpy as np",
"numpy",
"read = sys.stdin.buffer... | import sys
import numpy as np
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
L = np.array(read().split(), np.int32)[1:]
L.sort()
x = L[::2].sum()
print(x) |
[
7,
0,
13,
4,
13,
4,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
4,
18,
13,
13,
0,
13,
17,
28,
13,
4,
13,
13,
0,
13,
18,
13,
2,
13,
17,
4,
13,
13,
10,
17,
13,
10,
13,
13,
10,
4,
13,
10,
18,
13... | [
[
51,
2
],
[
10,
9
],
[
9,
18
],
[
48,
20
],
[
49,
24
],
[
45,
27
],
[
31,
30
],
[
52,
33
],
[
54,
35
],
[
49,
37
],
[
30,
39
],
[
55,
43
],
[
46,
43
],
[
4... | [
"n = int(input())\nl = [int(i) for i in input().split()]\nl.sort()\nans = 0\nfor i in range(n):\n ans += l[i*2]\nprint(ans)",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"int(i) for i in input().split()",
"for i in input().split()",
"i",
"input().split()",
"().split"... | n = int(input())
l = [int(i) for i in input().split()]
l.sort()
ans = 0
for i in range(n):
ans += l[i*2]
print(ans) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
39,
0,
13,
17,
28,
13,
4,
13,
13,
0,
13,
4,
13,
13,
4,
18,
13,
13,
13,
0,
13,
4,
13,
13,
4,
18,
13,
13,
13,
14,
2,
13,
13,
4,
18,
... | [
[
84,
2
],
[
96,
8
],
[
93,
20
],
[
78,
23
],
[
27,
26
],
[
85,
29
],
[
87,
31
],
[
97,
34
],
[
97,
37
],
[
88,
39
],
[
81,
41
],
[
97,
44
],
[
97,
47
],
[
... | [
"N = int(input())\nL = list(map(int, input().split()))\nvlist = []\nans = 0\n\nfor i in range(N):\n a = max(L)\n L.remove(a)\n b = max(L)\n L.remove(b)\n if a < b:\n vlist.append(a)\n else:\n vlist.append(b)\n\nfor i in range(N):\n ans += vlist[i]\n \nprint(ans)",
"N = int(input())",
"N",
"int(i... | 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) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
17,
28,
13,
4,
13,
17,
4,
13,
13,
17,
0,
13,
18,
13,
13,
4,
13,
13,
10,
18,
13,
10,
4,
13,
10,
4,
13,
10,
17,
13
] | [
[
50,
2
],
[
47,
8
],
[
48,
21
],
[
53,
24
],
[
28,
27
],
[
48,
33
],
[
44,
36
],
[
48,
38
],
[
27,
39
],
[
45,
42
],
[
54,
42
],
[
44,
45
],
[
47,
48
],
[
... | [
"N = int(input())\nL = list(map(int, input().split()))\n\nL.sort()\nans = 0\nfor i in range(0, len(L), 2):\n ans += L[i]\nprint(ans)",
"N = int(input())",
"N",
"int(input())",
"int",
"input()",
"input",
"L = list(map(int, input().split()))",
"L",
"list(map(int, input().split()))",
"list",
"... | 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) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
39,
28,
13,
4,
13,
2,
17,
13,
14,
2,
2,
13,
17,
17,
4,
18,
13,
13,
18,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13,
10,
4,
... | [
[
55,
2
],
[
52,
8
],
[
53,
21
],
[
58,
24
],
[
28,
27
],
[
56,
32
],
[
27,
36
],
[
59,
41
],
[
53,
44
],
[
27,
45
],
[
59,
50
],
[
52,
53
],
[
55,
56
],
[
... | [
"n = int(input())\nl = list(map(int,input().split()))\nl.sort()\n\na = []\n\nfor i in range(2*n):\n if i % 2 == 0:\n a.append(l[i])\n\n#print(a)\nprint(sum(a))",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"l = list(map(int,input().split()))",
"l",
"list(map(int,i... | n = int(input())
l = list(map(int,input().split()))
l.sort()
a = []
for i in range(2*n):
if i % 2 == 0:
a.append(l[i])
#print(a)
print(sum(a))
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
18,
4,
13,
13,
17,
28,
13,
4,
13,
17,
4,
13,
13,
0,
18,
13,
13,
4,
13,
18,
13,
13,
4,
18,
13,
13,
0,
13,
17,
28,
13,
4,
13,
17,
4,
13,
13,
17,
0,
13,
18,
13,
13,
14,
2,
13,... | [
[
81,
2
],
[
75,
8
],
[
17,
16
],
[
76,
22
],
[
27,
24
],
[
76,
25
],
[
16,
26
],
[
24,
29
],
[
76,
30
],
[
16,
31
],
[
76,
34
],
[
78,
37
],
[
41,
40
],
[
... | [
"N = int(input())\nL = input().split(\" \")\nfor i in range(0, len(L)):\n L[i] = int(L[i])\nL.sort()\n\nans = 0\nfor i in range(0, len(L), 2):\n tmp = L[i]\n if tmp > L[i+1]:\n tmp = L[i+1]\n ans += tmp\nprint(ans)",
"N = int(input())",
"N",
"int(input())",
"int",
"input()",
"input",
"L = input... | N = int(input())
L = input().split(" ")
for i in range(0, len(L)):
L[i] = int(L[i])
L.sort()
ans = 0
for i in range(0, len(L), 2):
tmp = L[i]
if tmp > L[i+1]:
tmp = L[i+1]
ans += tmp
print(ans) |
[
7,
0,
13,
4,
13,
4,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
13,
0,
13,
18,
13,
2,
17,
13,
4,
13,
13,
10,
18,
13,
10,
4,
13,
10,
4,
13,
10,
17,
13
] | [
[
49,
2
],
[
10,
9
],
[
9,
18
],
[
46,
20
],
[
52,
25
],
[
29,
28
],
[
50,
31
],
[
43,
33
],
[
47,
35
],
[
28,
38
],
[
44,
41
],
[
53,
41
],
[
43,
44
],
[
4... | [
"n=int(input())\nl=sorted([int(i) for i in input().split()])\nc=0\nfor i in range(n):\n c+=l[2*i]\nprint(c)",
"n=int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"int(i) for i in input().split()",
"for i in input().split()",
"i",
"input().split()",
"().split",
"()",
"input... | n=int(input())
l=sorted([int(i) for i in input().split()])
c=0
for i in range(n):
c+=l[2*i]
print(c)
|
[
7,
0,
13,
4,
13,
4,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
4,
13,
13,
4,
13,
4,
13,
18,
13,
39,
17,
10,
4,
13,
10,
4,
13
] | [
[
36,
2
],
[
10,
9
],
[
9,
18
],
[
33,
20
],
[
34,
29
],
[
33,
34
],
[
36,
37
]
] | [
"N = int(input())\nA = sorted([int(a) for a in input().split()])\nprint(sum(A[::2]))",
"N = int(input())",
"N",
"int(input())",
"int",
"input()",
"input",
"int(a) for a in input().split()",
"for a in input().split()",
"a",
"input().split()",
"().split",
"()",
"input",
"split",
"for a i... | N = int(input())
A = sorted([int(a) for a in input().split()])
print(sum(A[::2])) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
17,
28,
13,
4,
13,
17,
2,
17,
13,
17,
0,
13,
18,
13,
13,
4,
13,
13,
10,
18,
13,
10,
4,
13,
10,
17,
13,
10,
4,
13
] | [
[
53,
2
],
[
47,
8
],
[
48,
21
],
[
50,
24
],
[
28,
27
],
[
54,
33
],
[
44,
36
],
[
48,
38
],
[
27,
39
],
[
45,
42
],
[
51,
42
],
[
44,
45
],
[
47,
48
],
[
... | [
"n = int(input())\nl = list(map(int,input().split()))\nl.sort()\nskewers = 0\nfor i in range(0,2*n,2) :\n skewers += l[i]\n\nprint(skewers)",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"l = list(map(int,input().split()))",
"l",
"list(map(int,input().split()))",
"list",
... | n = int(input())
l = list(map(int,input().split()))
l.sort()
skewers = 0
for i in range(0,2*n,2) :
skewers += l[i]
print(skewers) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
17,
0,
13,
17,
28,
13,
4,
13,
13,
0,
13,
18,
13,
39,
13,
2,
13,
17,
0,
13,
4,
13,
13,
0,
13,
17,
4,
13,
13,
10,
18,
... | [
[
70,
2
],
[
58,
8
],
[
59,
21
],
[
73,
24
],
[
67,
27
],
[
31,
30
],
[
71,
33
],
[
55,
35
],
[
59,
37
],
[
74,
41
],
[
62,
41
],
[
64,
44
],
[
56,
47
],
[
... | [
"a = int(input())\nb = list(map(int,input().split()))\nb.sort()\nj = 0\nnum = 0\nfor i in range(a):\n c = b[j:j+2]\n num += min(c)\n j += 2\nprint(num)",
"a = int(input())",
"a",
"int(input())",
"int",
"input()",
"input",
"b = list(map(int,input().split()))",
"b",
"list(map(int,input().split())... | 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) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
17,
0,
13,
17,
28,
13,
13,
4,
13,
13,
14,
2,
2,
13,
17,
17,
0,
13,
13,
4,
13,
13,
10,
4,
13,
10,
13,
13,
10,
17,
13,
... | [
[
57,
2
],
[
48,
8
],
[
49,
21
],
[
25,
24
],
[
54,
27
],
[
49,
34
],
[
51,
42
],
[
52,
46
],
[
55,
46
],
[
48,
49
],
[
51,
52
],
[
54,
55
],
[
57,
58
]
] | [
"n = int(input())\nL = list(map(int, input().split()))\nL.sort(reverse=True)\nans = 0\nfor i, l in enumerate(L):\n if i%2 == 1:\n ans += l\nprint(ans)",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"L = list(map(int, input().split()))",
"L",
"list(map(int, input().... | n = int(input())
L = list(map(int, input().split()))
L.sort(reverse=True)
ans = 0
for i, l in enumerate(L):
if i%2 == 1:
ans += l
print(ans)
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
17,
28,
13,
4,
13,
13,
0,
13,
18,
13,
2,
13,
17,
4,
13,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13,
10,
18,
13
] | [
[
45,
2
],
[
48,
8
],
[
49,
21
],
[
42,
24
],
[
28,
27
],
[
46,
30
],
[
51,
32
],
[
49,
34
],
[
27,
36
],
[
52,
40
],
[
43,
40
],
[
42,
43
],
[
45,
46
],
[
... | [
"n = int(input())\na = list(map(int, input().split()))\n\na.sort()\n\nans = 0\nfor i in range(n):\n ans += a[i*2]\n\nprint(ans)",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"a = list(map(int, input().split()))",
"a",
"list(map(int, input().split()))",
"list",
"map(i... | n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = 0
for i in range(n):
ans += a[i*2]
print(ans) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
17,
2,
2,
17,
13,
17,
17,
0,
13,
4,
13,
18,
13,
13,
18,
13,
2,
13,
17,
4,
13,
13,
10,
17,
13,
... | [
[
60,
2
],
[
66,
8
],
[
63,
20
],
[
67,
23
],
[
54,
25
],
[
29,
28
],
[
61,
35
],
[
57,
39
],
[
64,
43
],
[
67,
43
],
[
28,
44
],
[
64,
46
],
[
67,
46
],
[
... | [
"n = int(input())\nl = list(map(int,input().split()))\nl = sorted(l)\nans = 0\nfor i in range(0,2*n-1,2):\n ans +=min(l[i],l[i+1])\nprint(ans)",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"l = list(map(int,input().split()))",
"l",
"list(map(int,input().split()))",
"li... | 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) |
[
7,
12,
13,
4,
18,
13,
13,
29,
4,
13,
18,
13,
39,
17,
17,
23,
13,
23,
13,
14,
2,
13,
17,
0,
13,
4,
13,
4,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
0,
13,
4,
13,
13,
13,
4,
13,
13,
10,
13,
1... | [
[
18,
5
],
[
18,
11
],
[
16,
16
],
[
18,
18
],
[
60,
24
],
[
32,
31
],
[
31,
40
],
[
54,
42
],
[
57,
45
],
[
64,
47
],
[
61,
48
],
[
55,
49
],
[
58,
52
],
[
... | [
"def BBQ_easy(N: int, L: list)->int:\n L.sort()\n return sum(L[0::2])\n\n\nif __name__ == \"__main__\":\n N = int(input())\n L = [int(s) for s in input().split()]\n\n ans = BBQ_easy(N, L)\n print(ans)",
"def BBQ_easy(N: int, L: list)->int:\n L.sort()\n return sum(L[0::2])",
"BBQ_easy",
... | 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)
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
13,
0,
13,
17,
0,
13,
17,
0,
13,
17,
42,
17,
14,
2,
13,
2,
17,
13,
3,
0,
13,
4,
13,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
1... | [
[
73,
2
],
[
67,
8
],
[
79,
20
],
[
68,
23
],
[
26,
25
],
[
61,
28
],
[
76,
31
],
[
77,
37
],
[
65,
37
],
[
74,
40
],
[
70,
43
],
[
80,
47
],
[
68,
47
],
[
... | [
"n = int(input())\nL = list(map(int, input().split()))\n\nL = sorted(L, reverse=True)\n\ncnt = 0\ni = 0\nwhile True:\n\tif i == 2*n:\n\t\tbreak\n\tcnt += min(L[i], L[i + 1])\n\ti += 2\n\nprint(cnt)",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"L = list(map(int, input().split()... | n = int(input())
L = list(map(int, input().split()))
L = sorted(L, reverse=True)
cnt = 0
i = 0
while True:
if i == 2*n:
break
cnt += min(L[i], L[i + 1])
i += 2
print(cnt) |
[
7,
0,
13,
4,
13,
13,
4,
18,
4,
18,
4,
13,
17,
13,
13,
31,
13,
0,
13,
4,
13,
13,
4,
13,
4,
13,
4,
13,
13,
18,
13,
39,
17,
18,
13,
39,
17,
17,
10,
4,
13,
10,
4,
13
] | [
[
39,
2
],
[
39,
15
],
[
42,
18
],
[
43,
30
],
[
43,
34
],
[
39,
40
],
[
42,
43
]
] | [
"N,*L=map(int, open(0).read().split())\nL=sorted(L)\nprint(sum(map(min, L[::2], L[1::2])))",
"N,*L=map(int, open(0).read().split())",
"N",
"map(int, open(0).read().split())",
"map",
"int",
"open(0).read().split()",
"(0).read().split",
"(0).read()",
"(0).read",
"(0)",
"open",
"0",
"read",
... | N,*L=map(int, open(0).read().split())
L=sorted(L)
print(sum(map(min, L[::2], L[1::2]))) |
[
7,
15,
13,
15,
13,
15,
13,
15,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
17,
28,
13,
4,
13,
17,
2,
13,
17,
17,
0,
13,
18,
13,
13,
4,
13,
13,
10,
17,
13,
10,
4... | [
[
58,
10
],
[
55,
16
],
[
56,
29
],
[
52,
32
],
[
36,
35
],
[
59,
40
],
[
61,
44
],
[
56,
46
],
[
35,
47
],
[
62,
50
],
[
53,
50
],
[
52,
53
],
[
55,
56
],
[
... | [
"# -*- coding: utf-8 -*-\n \nimport math\nimport itertools\nimport sys\nimport copy\n#import numpy as np\n \n# 入力\n#A, B, C, D = map(int, input().split())\n#L = list(map(int, input().split()))\n#S = list(str(input()))\n#N = int(input())\n#S = str(input())\n\nN = int(input())\nL = list(map(int, input().split()))\n\n... | # -*- coding: utf-8 -*-
import math
import itertools
import sys
import copy
#import numpy as np
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#S = list(str(input()))
#N = int(input())
#S = str(input())
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)
|
[
7,
15,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
4,
13,
13,
4,
18,
13,
13,
13,
0,
13,
17,
28,
13,
4,
13,
13,
0,
13,
4,
18,
13,
13,
13,
4,
18,
13,
13,
13,
0,
13,
13,
4,
13,
... | [
[
70,
4
],
[
67,
10
],
[
58,
22
],
[
68,
25
],
[
59,
30
],
[
73,
32
],
[
36,
35
],
[
71,
38
],
[
61,
40
],
[
59,
45
],
[
59,
50
],
[
64,
52
],
[
62,
53
],
[
... | [
"import heapq\nn = int(input())\nsrc = list(map(int, input().split()))\nsorted_src = sorted(src)\nheapq.heapify(sorted_src)\ncount = 0\nfor i in range(n):\n a = heapq.heappop(sorted_src)\n heapq.heappop(sorted_src)\n count += a\nprint(count)",
"import heapq",
"heapq",
"n = int(input())",
"n",
"in... | import heapq
n = int(input())
src = list(map(int, input().split()))
sorted_src = sorted(src)
heapq.heapify(sorted_src)
count = 0
for i in range(n):
a = heapq.heappop(sorted_src)
heapq.heappop(sorted_src)
count += a
print(count) |
[
7,
15,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
17,
28,
13,
18,
13,
39,
17,
17,
0,
13,
13,
4,
13,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13,
10,
13,
13
] | [
[
45,
4
],
[
48,
10
],
[
49,
23
],
[
42,
26
],
[
30,
29
],
[
49,
31
],
[
51,
36
],
[
29,
37
],
[
52,
40
],
[
43,
40
],
[
42,
43
],
[
45,
46
],
[
48,
49
],
[
... | [
"import sys\n\nkushiYaki = int(input())\n\nkushi = list(map(int, input().split()))\n\nkushi.sort()\n\nmax_ingredients = 0\n\nfor available_ingredient in kushi[0::2]:\n max_ingredients += available_ingredient\n\nprint(max_ingredients)",
"import sys",
"sys",
"kushiYaki = int(input())",
"kushiYaki",
"int(... | import sys
kushiYaki = int(input())
kushi = list(map(int, input().split()))
kushi.sort()
max_ingredients = 0
for available_ingredient in kushi[0::2]:
max_ingredients += available_ingredient
print(max_ingredients)
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
17,
0,
13,
17,
42,
2,
13,
2,
17,
13,
0,
13,
18,
13,
13,
0,
13,
17,
4,
13,
13,
10,
18,
13,
10,
17,
13,
10,
4,
13,
10,
... | [
[
53,
2
],
[
59,
8
],
[
60,
21
],
[
56,
24
],
[
50,
27
],
[
51,
31
],
[
63,
31
],
[
54,
34
],
[
47,
36
],
[
60,
38
],
[
51,
39
],
[
63,
39
],
[
62,
41
],
[
... | [
"N = int(input())\nL = list(map(int,input().split()))\nL.sort()\nans = 0\ni = 0\nwhile(i<2*N):\n ans += L[i]\n i += 2\nprint(ans)",
"N = int(input())",
"N",
"int(input())",
"int",
"input()",
"input",
"L = list(map(int,input().split()))",
"L",
"list(map(int,input().split()))",
"list",
"map(in... | 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) |
[
7,
15,
13,
4,
18,
13,
13,
2,
17,
17,
0,
13,
4,
13,
17,
0,
13,
2,
2,
17,
17,
17,
12,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
2,
2... | [
[
78,
11
],
[
81,
16
],
[
26,
25
],
[
32,
31
],
[
46,
45
],
[
49,
48
],
[
25,
52
],
[
48,
57
],
[
62,
61
],
[
31,
63
],
[
48,
64
],
[
61,
67
],
[
45,
67
],
[
... | [
"import sys\n\nsys.setrecursionlimit(10 ** 7)\nf_inf = float('inf')\nmod = 10 ** 9 + 7\n\n\ndef resolve():\n n = int(input())\n L = sorted(list(map(int, input().split())))\n\n res = 0\n for i in range(n * 2):\n if i % 2 == 0:\n res += L[i]\n print(res)\n\n\nif __name__ == '__main__'... | import sys
sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7
def resolve():
n = int(input())
L = sorted(list(map(int, input().split())))
res = 0
for i in range(n * 2):
if i % 2 == 0:
res += L[i]
print(res)
if __name__ == '__main__':
resolve()
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
4,
13,
4,
13,
18,
13,
2,
17,
13,
10,
4,
13,
10,
4,
13
] | [
[
33,
2
],
[
36,
8
],
[
37,
21
],
[
37,
28
],
[
33,
34
],
[
36,
37
]
] | [
"N = int(input())\nA = list(map(int, input().split()))\nA.sort()\nprint(sum(A[2*i] for i in range(N)))",
"N = int(input())",
"N",
"int(input())",
"int",
"input()",
"input",
"A = list(map(int, input().split()))",
"A",
"list(map(int, input().split()))",
"list",
"map(int, input().split())",
"ma... | N = int(input())
A = list(map(int, input().split()))
A.sort()
print(sum(A[2*i] for i in range(N))) |
[
7,
0,
13,
4,
13,
4,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
4,
18,
13,
13,
0,
13,
17,
28,
13,
4,
13,
2,
17,
13,
14,
2,
2,
13,
17,
17,
0,
13,
18,
13,
13,
4,
13,
13,
10,
4,
13,
10,
18,
13,
... | [
[
51,
2
],
[
10,
9
],
[
9,
18
],
[
57,
20
],
[
58,
24
],
[
60,
27
],
[
31,
30
],
[
52,
35
],
[
30,
39
],
[
54,
43
],
[
58,
45
],
[
30,
46
],
[
55,
49
],
[
6... | [
"n = int(input())\nl = [int(x) for x in input().split()]\n\nl.sort()\n\ncnt = 0\nfor i in range(2*n):\n if i%2 == 0:\n cnt += l[i]\n \nprint(cnt)",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"int(x) for x in input().split()",
"for x in input().split()",
"x... | 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) |
[
7,
0,
13,
4,
13,
4,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
4,
13,
4,
13,
18,
4,
13,
13,
39,
17,
10,
13,
13,
10,
4,
13
] | [
[
36,
2
],
[
10,
9
],
[
9,
18
],
[
33,
20
],
[
34,
29
],
[
33,
34
],
[
36,
37
]
] | [
"n = int(input())\nnum_list = [ int(v) for v in input().split() ]\nprint(sum(sorted(num_list)[::2]))",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"int(v) for v in input().split()",
"for v in input().split()",
"v",
"input().split()",
"().split",
"()",
"input",
"sp... | n = int(input())
num_list = [ int(v) for v in input().split() ]
print(sum(sorted(num_list)[::2])) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
17,
28,
13,
4,
13,
17,
4,
13,
13,
17,
0,
13,
4,
13,
18,
13,
13,
18,
13,
2,
13,
17,
4,
13,
13,
10,
4,
13,
10,
4,
13,
... | [
[
54,
2
],
[
51,
8
],
[
52,
21
],
[
57,
24
],
[
28,
27
],
[
52,
33
],
[
60,
36
],
[
52,
40
],
[
27,
41
],
[
52,
43
],
[
27,
45
],
[
61,
49
],
[
58,
49
],
[
... | [
"N = int(input())\nA = list(map(int, input().split()))\nA.sort()\nans = 0\nfor i in range(0, len(A), 2):\n ans += min(A[i], A[i + 1])\nprint(ans)",
"N = int(input())",
"N",
"int(input())",
"int",
"input()",
"input",
"A = list(map(int, input().split()))",
"A",
"list(map(int, input().split()))",
... | N = int(input())
A = list(map(int, input().split()))
A.sort()
ans = 0
for i in range(0, len(A), 2):
ans += min(A[i], A[i + 1])
print(ans) |
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
13,
0,
13,
4,
13,
18,
13,
2,
17,
13,
18,
13,
2,
2,
17,
13,
17,
4,
13,
13,
10,
4,
13,
10,
4,
13,
10,
17,
... | [
[
52,
2
],
[
49,
8
],
[
55,
22
],
[
26,
25
],
[
53,
28
],
[
58,
30
],
[
50,
34
],
[
25,
37
],
[
50,
39
],
[
25,
43
],
[
59,
47
],
[
56,
47
],
[
49,
50
],
[
... | [
"n = int(input())\nls = sorted(list(map(int, input().split())))\ntotal = 0\nfor i in range(n):\n total += min(ls[2*i], ls[2*i+1])\nprint(total)",
"n = int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"ls = sorted(list(map(int, input().split())))",
"ls",
"sorted(list(map(int, input... | 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) |
[
7,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
4,
18,
13,
13,
0,
13,
18,
13,
39,
17,
17,
0,
13,
4,
13,
13,
4,
13,
4,
13,
13,
10,
13,
13,
10,... | [
[
4,
3
],
[
3,
12
],
[
53,
14
],
[
19,
18
],
[
18,
27
],
[
62,
29
],
[
63,
33
],
[
59,
36
],
[
63,
38
],
[
56,
43
],
[
60,
46
],
[
57,
51
],
[
53,
54
],
[
5... | [
"N = [int(v) for v in input().split()]\nL = [int(v) for v in input().split()]\nL.sort()\nL_even=L[0::2]\ngoukei=sum(L_even)\nprint(str(goukei))",
"int(v) for v in input().split()",
"for v in input().split()",
"v",
"input().split()",
"().split",
"()",
"input",
"split",
"for v in input().split()",
... | 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))
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
4,
18,
13,
13,
0,
13,
17,
0,
13,
17,
28,
13,
4,
13,
17,
2,
4,
13,
13,
17,
14,
2,
2,
13,
17,
17,
0,
13,
4,
13,
18,
13,
13,
18,
13,
2,
13,
... | [
[
61,
2
],
[
70,
8
],
[
71,
21
],
[
25,
24
],
[
67,
27
],
[
31,
30
],
[
71,
37
],
[
30,
42
],
[
64,
46
],
[
71,
50
],
[
30,
51
],
[
71,
53
],
[
30,
55
],
[
... | [
"n=int(input())\nl=list(map(int,input().split()))\nl.sort(reverse=True)\nans=0\nfor i in range(0,len(l)-1):\n if i%2==0:\n ans+=min(l[i],l[i+1])\n\nprint(ans)\n",
"n=int(input())",
"n",
"int(input())",
"int",
"input()",
"input",
"l=list(map(int,input().split()))",
"l",
"list(map(int,inpu... | n=int(input())
l=list(map(int,input().split()))
l.sort(reverse=True)
ans=0
for i in range(0,len(l)-1):
if i%2==0:
ans+=min(l[i],l[i+1])
print(ans)
|
[
7,
15,
13,
4,
18,
13,
13,
2,
17,
17,
0,
13,
18,
18,
13,
13,
13,
12,
13,
0,
13,
4,
13,
4,
13,
41,
28,
13,
4,
18,
4,
13,
13,
4,
4,
13,
13,
0,
13,
13,
4,
18,
13,
13,
0,
13,
17,
28,
13,
4,
13,
17,
2,
13,
17,
17... | [
[
74,
11
],
[
21,
20
],
[
75,
24
],
[
28,
27
],
[
75,
31
],
[
27,
36
],
[
39,
38
],
[
38,
42
],
[
46,
45
],
[
49,
48
],
[
20,
53
],
[
58,
57
],
[
38,
59
],
[
... | [
"import sys\n\nsys.setrecursionlimit(10 ** 8)\n\ninput = sys.stdin.readline\n\n\ndef main():\n N = int(input())\n L = [int(x) for x in input().split()]\n\n L.sort()\n ans = 0\n for i in range(0, N * 2, 2):\n ans += L[i]\n\n print(ans)\n\n\n\n\nif __name__ == '__main__':\n main()",
"imp... | import sys
sys.setrecursionlimit(10 ** 8)
input = sys.stdin.readline
def main():
N = int(input())
L = [int(x) for x in input().split()]
L.sort()
ans = 0
for i in range(0, N * 2, 2):
ans += L[i]
print(ans)
if __name__ == '__main__':
main()
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.