submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s976343484
p04047
Accepted
n = int(input()) lst = list(map(int, input().split())) lst.sort() ret = 0 for i in range(n): ret += lst[2*i] 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>
s116225091
p04047
Accepted
def main(): n=int(input()) l=list(map(int,input().split())) l.sort() ans=0 for i in range(n): ans+=l[i*2] 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>
s645486694
p04047
Accepted
#!usr/bin/env python3 from collections import defaultdict from heapq import heappush, heappop import sys import math import bisect import random def LI(): return list(map(int, sys.stdin.readline().split())) def I(): return int(sys.stdin.readline()) def LS():return list(map(list, sys.stdin.readline().split())) def S(): return list(sys.stdin.readline())[:-1] def IR(n): l = [None for i in range(n)] for i in range(n):l[i] = I() return l def LIR(n): l = [None for i in range(n)] for i in range(n):l[i] = LI() return l def SR(n): l = [None for i in range(n)] for i in range(n):l[i] = S() return l def LSR(n): l = [None for i in range(n)] for i in range(n):l[i] = SR() return l mod = 1000000007 #A n = I() l = LI() l.sort() ans = 0 for i in range(n): ans += l[2*i] print(ans) #B #C #D #E #F #G #H #I #J #K #L #M #N #O #P #Q #R #S #T
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>
s524783331
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>
s160167529
p04047
Accepted
N = int(input()) L = [int(i) for i in input().split()] L.sort() ans = 0 for i,j in zip(L[::2], L[1::2]): ans += min(i, 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>
s734580199
p04047
Accepted
n = int(input()) l = list(map(int,input().split())) l = sorted(l) 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>
s854890339
p04047
Accepted
n=int(input()) l=list(map(int,input().split())) l.sort() ans=sum(l[0::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>
s248891030
p04047
Accepted
n = int(input()) Ls = list(map(int,input().split())) Ls.sort() ans = 0 for L in Ls[0::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>
s046228277
p04047
Accepted
N=int(input()) L=list(map(int,input().split())) L.sort() ans=0 for i in range(N): 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>
s202660927
p04047
Accepted
n=int(input()) l=list(map(int,input().split())) l.sort() sum=0 for i in range(0,2*n,2): sum+=min(l[i],l[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>
s098370266
p04047
Accepted
n = int(input()) l = sorted(list(map(int,input().split()))) a = 0 for i in range(0,len(l),2): 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>
s793249243
p04047
Accepted
a = 0 n = int(input()) le = list(map(int, input().split())) le.sort() le2 = [] le2 = le[0::2] print (str(sum(le2)))
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>
s230778464
p04047
Accepted
N = int(input()) L = [int(i) for i in input().split()] L.sort() ans = 0 while len(L) != 0: ans += min(L.pop(0), L.pop(0)) 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>
s514632482
p04047
Accepted
N = int(input()) L = list(map(int, input().split())) L.sort() print(sum(L[-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>
s393466507
p04047
Accepted
N=int(input()) L=list(map(int,input().split())) L.sort() i=0 sum1=0 while i<2*N: sum1+=L[i] i=i+2 print(sum1)
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>
s973162065
p04047
Accepted
N = int(input()) L = list(map(int,input().split())) L_sorted = sorted(L) ans = 0 for i in range(N): ans += L_sorted[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>
s126548679
p04047
Accepted
n=int(input()) l=[int(i) for i in input().split()] l.sort() #print(n,l) 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>
s495975857
p04047
Accepted
N = int(input()) L = list(map(int, input().split())) L.sort() i = 0 res = 0 for _ in range(N): res += min(L[i], L[i+1]) i = i + 2 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>
s184520144
p04047
Accepted
n = int(input()) a = list(map(int,input().split())) a.sort() cnt = 0 for i in range(n): cnt += min(a[i*2], a[i*2+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>
s516892879
p04047
Accepted
n=int(input()) l=list(map(int,input().split())) l.sort() ans=0 i=0 while i<n*2-1: ans+=l[i] i+=2 print(ans)
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>
s226650166
p04047
Accepted
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>
s101075750
p04047
Accepted
n = int(input()) ll = sorted(list(map(int, input().split()))) print(sum(ll[::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>
s575155351
p04047
Accepted
n=int(input()) kushi = list(map(int,input().split())) kushi.sort() result=0 for i in range(len(kushi)//2): result+=kushi[i*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>
s068881146
p04047
Accepted
# coding:utf-8 import sys INF = float('inf') MOD = 10 ** 9 + 7 def LI(): return [int(x) for x in sys.stdin.readline().split()] def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()] def LF(): return [float(x) for x in sys.stdin.readline().split()] def LS(): return sys.stdin.readline().split() def II(): return int(sys.stdin.readline()) def SI(): return input() def main(): n = II() L = LI() L.sort() ans = 0 for i in range(0, 2 * n, 2): ans += min(L[i], L[i + 1]) return ans print(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>
s426702574
p04047
Accepted
N=int(input()) List =[int(i) for i in input().split()] List.sort() new_list = List[0::2] print(sum(new_list))
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>
s976280312
p04047
Accepted
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>
s840479425
p04047
Accepted
N=int(input()) L=list(map(int,input().split())) L.sort() ans=0 for i in range(2*N): if i%2==0: ans+=L[i] print(ans)
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>
s200363600
p04047
Accepted
_,*a=map(int,open(0).read().split()) a=sorted(a) if len(a)%2==1: del a[0] print(sum(a[s]for s in range(0,len(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>
s699080922
p04047
Accepted
N = int(input()) L = sorted(list(map(int,input().split()))) ans = 0 for i in range(0,N*2,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>
s405781617
p04047
Accepted
n = int(input()) a = list(map(int,input().split())) a = sorted(a) 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>
s548319384
p04047
Accepted
n = int(input()) l = sorted(list(map(int, input().split()))) s = 0 for i in range(0,n*2,2): s += l[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>
s381271607
p04047
Accepted
import numpy as np from sys import stdin N=int(stdin.readline().rstrip()) data=[int(x) for x in stdin.readline().rstrip().split()] print(sum(sorted(data)[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>
s921254751
p04047
Accepted
n = int(input()) kusi = [int(x) for x in input().split()] ans = 0 kusi.sort(reverse = True) for i in range(n): ans += kusi[i*2+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>
s881355097
p04047
Accepted
N = int(input()) Ls = list(map(int, input().split())) Ls.sort() sum = 0 for i in range(0,len(Ls), 2): sum += Ls[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>
s716553727
p04047
Accepted
n = int(input()) table = list(map(int,input().split())) table.sort() count = 0 for i in range(2*n): if i%2 == 0: count += table[i] else: pass print(count)
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>
s215777195
p04047
Accepted
n = int(input()) l = list(map(int, input().split())) l.sort() ans = 0 for i in range(2 * n): if i % 2 == 0: ans += l[i] print(ans)
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>
s058572448
p04047
Accepted
#-*- coding: utf-8 -*- N = int(input()) L_list = list(map(int, input().split())) L_list.sort() print(sum(L_list[::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>
s170381027
p04047
Accepted
n = int(input()) l = list(int(i) for i in input().split()) ans = 0 l2 = sorted(l,reverse =True) for i in range(0,2*n-1,2): ans += min(l2[i],l2[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>
s579633018
p04047
Accepted
N = int(input()) L = list(map(int, input().split())) cnt = 0 sL = sorted(L) for i in range(N): sL.pop() cnt += sL.pop() 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>
s004308776
p04047
Accepted
n = int(input()) l = [int(m) for m in input().split()] l.sort() 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>
s643425146
p04047
Accepted
N = int(input()) L = list(map(int, input().split(" "))) L.sort(reverse=True) print(sum(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>
s788577416
p04047
Accepted
n = int(input()) l = list(map(int, input().split())) l.sort() l.reverse() print(sum(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>
s222066851
p04047
Accepted
a=int(input()) b = sorted(list(map(int,input().split()))) print(sum(b[0:len(b):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>
s507797399
p04047
Accepted
n = int(input()) l = input().split(" ") l = [int(x) for x in l] l.sort(reverse = True) s= 0 for i in range(0, n): a = i * 2 b = i * 2 + 1 m = min(l[a], l[b]) s += m 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>
s004708636
p04047
Accepted
N = int(input()) kushi = 2 * N l = input().rstrip().split(" ") L = [] for i in range(kushi): L.append(int(l[i])) L.sort() x = 0 for i in range(len(L)): if i % 2 == 0: x += L[i] 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>
s633223669
p04047
Accepted
n = int(input()) l2n = [int(l) for l in input().split(" ")] l2n = sorted(l2n) ln = [l2n[i] for i in range(0, len(l2n), 2)] res = sum(ln) 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>
s397695330
p04047
Accepted
N = int(input()) L = map(int, input().split(" ")) L = sorted(L) tmp= 0 for i in range(N): tmp += L[i*2] print(tmp)
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>
s169531019
p04047
Accepted
# python template for atcoder1 import sys sys.setrecursionlimit(10**9) input = sys.stdin.readline N = int(input()) A = list(map(int, input().split())) A = sorted(A) print(sum(A[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>
s180840730
p04047
Accepted
N = int(input()) L = list(map(int,input().split())) L = sorted(L) ans = 0 while len(L) : if len(L) == 1 : ans += L[0] L.pop(0) else : ans += L.pop(0) L.pop(0) 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>
s620782716
p04047
Accepted
import sys stdin = sys.stdin sys.setrecursionlimit(10**5) def li(): return map(int, stdin.readline().split()) def li_(): return map(lambda x: int(x)-1, stdin.readline().split()) def lf(): return map(float, stdin.readline().split()) def ls(): return stdin.readline().split() def ns(): return stdin.readline().rstrip() def lc(): return list(ns()) def ni(): return int(stdin.readline()) def nf(): return float(stdin.readline()) n = ni() l = sorted(list(li())) 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>
s831487735
p04047
Accepted
N = int(input()) L = list(map(int,input().split())) L.sort() 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>
s759917527
p04047
Accepted
def inpl(): return list(map(int, input().split())) N = int(input()) L = sorted(inpl()) 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>
s630580547
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(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>
s205462902
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>
s519019052
p04047
Accepted
N = int(input()) L = list(map(int, input().split())) L.sort(reverse=True) res = 0 for i in range(0, len(L), 2): res += min(L[i], L[i + 1]) 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>
s642493992
p04047
Accepted
a = input() lst = list(map(int,input().split(" "))) lst.sort() ans=0 for i in range(int(len(lst)/2)): ans += lst[len(lst)-2*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>
s713433783
p04047
Accepted
N = int(input()) a = list(map(int, input().split())) a.sort() count = 0 for i in range(N): count += a[2*i] 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>
s592727929
p04047
Accepted
N = int(input()) L = list(map(int, input().split())) L.sort() x = 0 for i in range(0, 2*N, 2): x += L[i] 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>
s660200412
p04047
Accepted
# -*- coding: utf-8 -*- import sys, re from collections import deque, defaultdict, Counter from math import sqrt, hypot, factorial, pi, sin, cos, radians if sys.version_info.minor >= 5: from math import gcd else: from fractions import gcd from heapq import heappop, heappush, heapify, heappushpop from bisect import bisect_left, bisect_right from itertools import permutations, combinations, product from operator import itemgetter, mul from copy import deepcopy from functools import reduce, partial from fractions import Fraction from string import ascii_lowercase, ascii_uppercase, digits def input(): return sys.stdin.readline().strip() def ceil(a, b=1): return int(-(-a // b)) def round(x): return int((x*2+1) // 2) def fermat(x, y, MOD): return x * pow(y, MOD-2, MOD) % MOD def lcm(x, y): return (x * y) // gcd(x, y) def lcm_list(nums): return reduce(lcm, nums, 1) def gcd_list(nums): return reduce(gcd, nums, nums[0]) def INT(): return int(input()) def MAP(): return map(int, input().split()) def LIST(): return list(map(int, input().split())) sys.setrecursionlimit(10 ** 9) INF = float('inf') MOD = 10 ** 9 + 7 N = INT() L = LIST() L.sort(reverse=True) ans = 0 for i in range(1, 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>
s023611746
p04047
Accepted
N = int(input()) l = [int(x) for x in input().split(" ")] import numpy as np ans=0 while len(l) !=0: x=0 y=0 x+=max(l) l.pop(np.argmax(l)) y+=max(l) l.pop(np.argmax(l)) ans+=min(x,y) 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>
s938986030
p04047
Accepted
input_word = input() N = int(input_word) input_word = input() tmp_list = input_word.split(" ") input_list = [ int(i) for i in tmp_list ] input_list.sort() output = 0 for i in range(N): output += input_list[2*i] print(output)
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>
s634357384
p04047
Accepted
n = int(input()) l = list(map(int, input().split())) l.sort() ans = 0 for i in range(n): 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>
s882079763
p04047
Accepted
N = int(input()) arr = [int(i) for i in input().split()] arr.sort() result = 0 for i in range(len(arr)//2): result += arr[i*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>
s081602822
p04047
Accepted
N = int(input()) l = [int(i) for i in input().split()] l.sort() count = 0 for i in range(len(l) // 2) : count += l[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>
s321980442
p04047
Accepted
N = int(input()) L = sorted([int(l) for l in input().split()], reverse=True) print(sum(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>
s573867623
p04047
Accepted
input() a=list(map(int,input().split())) a.sort() ans=0 while(len(a)>0): ans+=a[0] a=a[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>
s978787179
p04047
Accepted
_ = input() a = [int(i) for i in input().split()] a.sort() b = [a[i] for i in range(len(a)) if i % 2 == 0 ] 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>
s146619672
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>
s835021497
p04047
Accepted
import sys input = sys.stdin.readline N = int(input()) kushi = sorted(list(map(int,input().split()))) sum = 0 for i in range(0,2*N,2): sum += kushi[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>
s892975584
p04047
Accepted
N = int(input()) kushi = sorted(list(map(int,input().split()))) sum = 0 for i in range(0,2*N,2): sum += kushi[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>
s117957140
p04047
Accepted
N = int(input()) kushi = sorted(list(map(int,input().split()))) sum = 0 for i in range(2*N): if i % 2 == 0: sum += kushi[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>
s822524961
p04047
Accepted
n = int(input()) a = sorted(list(map(int, input().split()))) ans = 0 for i in range(0,2*n,2): ans += a[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>
s361750556
p04047
Accepted
a=int(input()) ar=list(map(int,input().split())) ar.sort() count=0 for i in range(0,a*2,2): count+=ar[i] 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>
s348748108
p04047
Accepted
N = int(input()) inputs = sorted([int(i) for i in input().split()]) ans = 0 for i in range(N): ans += min(inputs[2*i: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>
s340117548
p04047
Accepted
n = int(input()) A = sorted(list(map(int, input().split()))) ans = 0 flag = True for i in reversed(range(len(A))): if flag is False: flag = True continue if i - 1 < 0: continue ans += A[i - 1] flag = False print(ans)
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>
s876251094
p04047
Accepted
import numpy as np n = int(input()) l = list(map(int, input().split())) ans = np.sum(np.sort(l)[np.arange(0, n*2, 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>
s858618987
p04047
Accepted
n=int(input()) l=sorted(list(map(int,input().split())),reverse=True) print(sum(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>
s867562455
p04047
Accepted
n = input() print sum(sorted(map(int, raw_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>
s219087759
p04047
Accepted
N = int(input()) al = sorted(list(map(int,input().split()))) sum = 0 for i in range(N): sum += al[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>
s452235355
p04047
Accepted
N=int(input()) L=list(map(int,input().split(' '))) L.sort() L=L[::2] print(sum(L))
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>
s152803490
p04047
Accepted
a = int(input()) l = list(map(int, input().split())) l.sort() res=0 for i in range(len(l)//2): res+=l[i*2] 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>
s216075759
p04047
Accepted
import sys from collections import deque import copy import math def get_read_func(fileobject): if fileobject == None : return raw_input else: return fileobject.readline def main(): if len(sys.argv) > 1: f = open(sys.argv[1]) else: f = None read_func = get_read_func(f); input_raw = read_func().strip().split() [N] = [int(input_raw[0])] input_raw = read_func().strip().split() L = [] for i in range(2 * N): L.append(int(input_raw[i])) L.sort(reverse=True) count = 0 for i in range(0,len(L),2): if i + 1 < len(L): count += min(L[i], L[i + 1]) print count 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>
s244227152
p04047
Accepted
N = int(input()) L = list(map(int, input().split())) ans = 0 L.sort() 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>
s121354597
p04047
Accepted
N = int(input()) L = list(map(int,input().split())) L.sort() ans = 0 for i in range(0,2*N - 1,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>
s142974229
p04047
Accepted
a = int(input()) ar = list(map(int,input().split(" "))) ar.sort() count = 0 for i in range(0,a*2,2): count += min(ar[i],ar[i+1]) 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>
s931753074
p04047
Accepted
n=int(input()) result = 0 lst=sorted(list(map(int,input().split()))) for i in range(len(lst)): if i%2 == 0: result += lst[i] 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>
s619196708
p04047
Accepted
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>
s476973418
p04047
Accepted
N = int(input()) L = list(map(int,input().split())) L.sort(reverse=True) ans = 0 for a,b in zip(L[::2],L[1::2]): 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>
s241500165
p04047
Accepted
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>
s860808593
p04047
Accepted
N=int(input()) L=list(map(int, input().split())) L_sort = sorted(L) temp=0 for i in range(0,2*N,2): temp += L_sort[i] print(temp)
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>
s776861208
p04047
Accepted
import sys stdin = sys.stdin sys.setrecursionlimit(10**5) def li(): return map(int, stdin.readline().split()) def li_(): return map(lambda x: int(x)-1, stdin.readline().split()) def lf(): return map(float, stdin.readline().split()) def ls(): return stdin.readline().split() def ns(): return stdin.readline().rstrip() def lc(): return list(ns()) def ni(): return int(stdin.readline()) def nf(): return float(stdin.readline()) n = ni() l = sorted(list(li())) 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>
s642614683
p04047
Accepted
N=int(input()) L=list(map(int, input().split())) L_sort = sorted(L) temp=0 for i in range(0,2*N,2): temp += L_sort[i] print(temp)
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>
s371188187
p04047
Accepted
# -*- coding: utf-8 -*- def main(): """Function.""" n = int(input()) kushi = list(map(int, input().split())) kushi.sort() total = 0 for i in range(n): total += kushi[i*2] print(total) 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>
s238383676
p04047
Accepted
# coding: utf-8 N = int(input()) lst = sorted(map(int, input().split())) print(sum(lst[::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>
s067947983
p04047
Accepted
n = int(input()) Ls = list(map(int, input().split())) Ls.sort(reverse=True) diff = [] i = 0 while i + 1 <= len(Ls) : diff.append( min(Ls[i], Ls[i+1]) ) i += 2 diff.sort(reverse=True) ans = 0 for i in range(n): ans += diff[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>
s092774631
p04047
Accepted
# coding: utf-8 N = int(input()) lst = sorted(map(int, input().split())) print(sum([lst[i] for i in range(2*N) if i %2==0]))
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>
s444334832
p04047
Accepted
# coding: utf-8 N = int(input()) lst = sorted(map(int, input().split())) cnt = 0 for i in range(0, 2*N, 2): cnt += min(lst[i], lst[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>
s206475497
p04047
Accepted
N = int(input()) L = list(map(int, input().split())) L.sort() ans = 0 for i in range(2*N): if i%2==0: ans += L[i] print(ans)
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>
s429527997
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>
s911544944
p04047
Accepted
N = int(input()) meats = list(map(int, input().strip().split())) meats.sort() answer = 0 index = 0 for meat in meats: if(index % 2 == 0): answer += meat index += 1 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>