submission_id string | problem_id string | status string | code string | input string | output string | problem_description string |
|---|---|---|---|---|---|---|
s630394389 | p04047 | Accepted | N = int(input())
L = [int(i) for i in input().split()]
L.sort()
ans = 0
for i in range(0, 2*N, 2):
ans += min(L[i], L[i+1])
print(ans) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s519099817 | p04047 | Accepted | n = int(input())
l = [int(i) for i in input().split()]
l = sorted(l)
# 大きいものは大きいもの同士でペアを組んだ方がよい
# a>b>c>dで, 「b+d>c+d」より証明完了
count = 0
# print(l)
for i in range(n):
count += l[i*2]
# print(i)
print("{}".format(count)) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s912291047 | p04047 | Accepted | n = int(input())
L = list(map(int, input().split()))
L.sort()
ans = 0
for i in range(n):
ans += L[2*i]
print(ans)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s460026072 | p04047 | Accepted | n = int(input())
x = list(map(int, input().split()))
x.sort()
ans = 0
for i in range(n):
ans = ans + x[i*2]
print(ans) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s523289631 | p04047 | Accepted | N = int(input())
L = list(map(int, input().split()))
L.sort()
ans = 0
for i in range(N):
ans = ans + L[i*2]
print(ans)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s073684994 | p04047 | Accepted | """取込"""
n = int(input())
data = sorted([int(i) for i in input().split(" ")])
"""問題"""
# import pdb; pdb.set_trace(
score = sum(data[-2::-2])
"""出力"""
print(score)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s967554979 | p04047 | Accepted | N = int(input())
L = list(map(int,input().split()))
L.sort()
print(sum(L[::2]))
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s254376774 | p04047 | Accepted | n = int(input())
l = list(map(int,input().split()))
l.sort()
res = 0
for i in range(n):
res += l[2*i]
print(res) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s519130401 | p04047 | Accepted | input()
print(sum(sorted([int(_) for _ in input().split()])[0::2]))
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s908272095 | p04047 | Accepted | N = int(input())
L = list(map(int, input().split()))
L.sort()
ans = 0
for i in range(N):
ans = ans + L[i*2]
print(ans) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s799921103 | p04047 | Accepted | N = int(input())
L = list(map(int, input().split()))
print(sum(sorted(L)[::2]))
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s774166090 | p04047 | Accepted | n = int(input())
l = sorted(list(map(int,input().split())))
c = 0
for i in range(n):
c += l[2*i]
print(c) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s257925830 | p04047 | Accepted | n = input()
arr = map(int,raw_input().split())
arr.sort()
ans = 0
for i in range(0,2*n,2):
ans += arr[i]
print ans | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s394510107 | p04047 | Accepted | # -*- coding: utf-8 -*-
n = int(input())
kusi = [int(s) for s in input().split()]
kusi.sort()
bbq = []
cnt = 0
for i in range(0, 2*n, 2):
cnt += kusi[i]
print(cnt)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s341882394 | p04047 | Accepted | a = int(input())
b = list(map(int,input().split()))
b = sorted(b)
print(sum(b[0::2])) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s597845964 | p04047 | Accepted | n = int(input())
l = list(map(int, input().split()))
l.sort()
m = 0
for i in range(n):
m = m + l[2*i]
print(m) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s395081424 | p04047 | Accepted | n=int(input())
a=list(map(int,input().split()))
a.sort()
b=a[::2]
print(sum(b))
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s557098448 | p04047 | Accepted | 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
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]
def inside(y, x, H, W):
return 0 <= y < H and 0 <= x < W
def ceil(a, b):
return (a + b - 1) // b
# aとbの最大公約数
def gcd(a, b):
if b == 0:
return a
return gcd(b, a % b)
# aとbの最小公倍数
def lcm(a, b):
g = gcd(a, b)
return a / g * b
def main():
N = int(input())
L = list(sorted(list(map(int, input().split()))))
ans = 0
for i in range(0, len(L), 2):
ans += L[i]
print(ans)
if __name__ == '__main__':
main()
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s058717868 | p04047 | Accepted | N=int(input())
L=list(map(int,input().strip().split()))
an=0
for i in range(N):
kusi=[]
kusi.append(min(L))
L.remove(min(L))
kusi.append(min(L))
L.remove(min(L))
an+=min(kusi)
print(an) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s568082398 | p04047 | Accepted | import sys
def main():
x = int(input())
lst = list(int(x) for x in input().split(' '))
lst.sort()
ans = 0
for i in range(0,x*2,2):
ans += int(lst[i])
print(ans)
main()
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s656738349 | p04047 | Accepted | 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)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s197044177 | p04047 | Accepted | n=int(input());l=list(map(int,input().split()))
l.sort()
print(sum(l[::2])) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s574482299 | p04047 | Accepted | 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s155543636 | p04047 | Accepted | 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s188781770 | p04047 | Accepted | 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s936254289 | p04047 | Accepted | 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s107911840 | p04047 | Accepted | n = int(input())
a = list(map(int, input().split()))
a.sort()
print(sum(map(min, zip(a[::2], a[1::2]))))
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s474850024 | p04047 | Accepted | 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)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s226145692 | p04047 | Accepted | 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s122870585 | p04047 | Accepted | 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s634969251 | p04047 | Accepted | 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)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s815095861 | p04047 | Accepted | 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() | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s142257804 | p04047 | Accepted | 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() | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s082331440 | p04047 | Accepted | 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s240699110 | p04047 | Accepted | n = int(input())
lis = list(map(int,input().split()))
lis.sort()
ans = 0
for i in range(n):
ans += lis[2*i]
print(ans) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s575291927 | p04047 | Accepted | input()
datas = sorted(map(int, input().split()), reverse=True)
print(sum([min(datas[x:x+2]) for x in range(0, len(datas), 2)])) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s323085579 | p04047 | Accepted | 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s095355750 | p04047 | Accepted | 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s533053760 | p04047 | Accepted | 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s009189014 | p04047 | Accepted | 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s690772098 | p04047 | Accepted | n = int(input())
l = sorted(list(map(int, input().split())))
ans = 0
for i in range(n):
ans += l[2*i]
print(ans)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s230215182 | p04047 | Accepted | 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)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s492157069 | p04047 | Accepted | 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s717911503 | p04047 | Accepted | 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s497518619 | p04047 | Accepted | 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)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s556665359 | p04047 | Accepted | 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)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s948210221 | p04047 | Accepted | 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)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s565406375 | p04047 | Accepted | N = int(input())
list_input = sorted(map(int, input().split()))
print(sum(list_input[::2])) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s926836468 | p04047 | Accepted | 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 | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s109125565 | p04047 | Accepted | n=int(input())
a=list(map(int, input().split()))
a.sort()
print(sum(a[::2])) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s099170860 | p04047 | Accepted | n = int(input())
a = list(map(int,input().split()))
a.sort()
print(sum(a[::2])) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s433531002 | p04047 | Accepted | 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)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s876580443 | p04047 | Accepted | N = int(input())
A = list(map(int, input().split()))
A.sort()
ans = 0
for i in range(N):
ans += A[2*i]
print(ans) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s026084762 | p04047 | Accepted | n = input()
arr = list(map(int,input().split()))
s = 0
arr.sort()
arr = arr[::2]
for i in arr:
s += i
print(s) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s894861782 | p04047 | Accepted | N = int(input())
L = sorted(map(int, input().split()))
print(sum(min(a, b) for a, b in zip(L[::2], L[1::2]))) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s062223905 | p04047 | Accepted | 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s907665795 | p04047 | Accepted | 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s775309527 | p04047 | Accepted | n=input();print(sum(sorted(map(int,input().split()))[::2])) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s360096895 | p04047 | Accepted | n=int(input())
l=list(map(int,input().split()))
l.sort()
print(sum(l[0::2])) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s840975235 | p04047 | Accepted | 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)) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s267407488 | p04047 | Accepted | # 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s919593870 | p04047 | Accepted | 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s946617492 | p04047 | Accepted | 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)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s827993277 | p04047 | Accepted | 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)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s664682180 | p04047 | Accepted | 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() | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s825214278 | p04047 | Accepted | n=int(input())
l=sorted(map(int,input().split()))
print(sum(l[i] for i in range(0,n*2,2))) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s711992242 | p04047 | Accepted | 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s671232434 | p04047 | Accepted | 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s234269323 | p04047 | Accepted | n=int(input())
s=input().split()
l=[int(s[i]) for i in range(2*n)]
l.sort()
print(sum(l[0::2])) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s081524959 | p04047 | Accepted | a = int(input())
b = list(map(int,input().split()))
b.sort()
su = 0
for i in range(a):
su += b[2*i]
print(su) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s479864311 | p04047 | Accepted | 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s187499339 | p04047 | Accepted | N = int(input())
L = [int(_) for _ in input().split()]
result = sum(sorted(L)[::2])
print(result)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s646645995 | p04047 | Accepted | 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)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s408661615 | p04047 | Accepted | N = int(input())
Ls = list(map(int, input().split()))
Ls.sort()
print(sum(Ls[::2]))
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s150474846 | p04047 | Accepted | 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()
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s336334496 | p04047 | Accepted | 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s502440204 | p04047 | Accepted | 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s017531356 | p04047 | Accepted | input();print(sum(sorted(list(map(int,input().split())))[::2])) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s660739027 | p04047 | Accepted | n = int(input())
l = list(map(int, input().split()))
l_sorted = sorted(l)
print(sum(l_sorted[::2])) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s305044484 | p04047 | Accepted | N = int(input())
L = list(map(int, input().split()))
L.sort()
guz = 0
for i in range(N):
guz += L[i*2]
print(guz) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s464584237 | p04047 | Accepted | 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s282554909 | p04047 | Accepted | 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s425491711 | p04047 | Accepted | N = int(input())
L = list(map(int, input().split()))
L.sort()
s = 0
for i in range(N):
s += L[2 * i]
print(s) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s720895502 | p04047 | Accepted | N = int(input())
l = sorted(list(map(int, input().split()))).pop
sum = 0
for i in range(N):
l()
sum += l()
print(sum) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s127917895 | p04047 | Accepted | 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s472575827 | p04047 | Accepted | 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s493176191 | p04047 | Accepted | n = int(input())
l = list(map(int, input().split()))
l.sort()
ans = 0
for i in range(n):
ans += l[2*i]
print(ans)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s362724474 | p04047 | Accepted | n = int(input())
l = sorted(list(map(int, input().split())))
print(sum([l[i] for i in range(0, 2 * n, 2)])) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s449574172 | p04047 | Accepted | N = input()
Li = list(map(int, input().split(" ")))
Li.sort()
total = 0
for i in Li[0::2]:
total += i
print(total)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s878591723 | p04047 | Accepted | 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s865700484 | p04047 | Accepted | N = int(input())
length = list(map(int, input().split(' ')))
length.sort()
print(sum(length[0::2])) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s437796375 | p04047 | Accepted | 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s563946379 | p04047 | Accepted | 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)) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s810413489 | p04047 | Accepted | 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s814195536 | p04047 | Accepted | 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s373631686 | p04047 | Accepted | 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) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s445167434 | p04047 | Accepted | 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()
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s884178396 | p04047 | Accepted | n = int(input())
arr = list(map(int,input().split()))
arr.sort()
ans = [_ for num,_ in enumerate(arr) if num % 2 == 0]
print(sum(ans)) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s161912918 | p04047 | Accepted | N = int(input())
L = list(map(int, input().split()))
L.sort()
print(sum(L[::2]))
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s217714568 | p04047 | Accepted | n = int(input())
arr = map(int,raw_input().split())
arr.sort()
count = 0
for i in range(n):
count += arr[i*2]
print count
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.