submission_id string | problem_id string | status string | code string | input string | output string | problem_description string |
|---|---|---|---|---|---|---|
s420396881 | p04047 | Runtime Error | N = int(input())
L = list(map(int, input().split()))
L.sort()
S = 0
for i in range (0, 2*N+1, 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> |
s838662080 | p04047 | Runtime Error |
num = int(input())
li = int(input().split())
print(num)
print(li) | 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> |
s315159115 | p04047 | Runtime Error | N=ita(input())
A=[]
A=[int(x) for x in input().split()]
A.sort()
k=0
for i in range(N):
k+=A[2*i]
print(k) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s665951821 | p04047 | Runtime Error | def pair(n,count):
l=[];su=0
for i in range(0,len(n),2):
sub=list()
sub.append(n[i:i+2])
su=su+sub[0][0]
l.append(sub)
return(su)
ip1=int(input())
ip2=[]
for i in range(ip1*2):
ip2.append(int(input()))
ip2.sort()
print(pair(ip2,ip1)) | 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> |
s297588072 | p04047 | Runtime Error | def main(p1,p2):
print(p1)
print(p2)
L_np = np.sort(np.array(p2))
x_total = 0
for i in range(p1):
x_total += L_np[2*i]
print(x_total)
if __name__ == "__main__":
#a = [int(input()) for i in range(5)]
N = int(input())
L = [int(item) for item in input().split()]
main(N,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> |
s854036133 | p04047 | Runtime Error | #include <iostream>
using namespace std;
int main(void){
int n,i,j,ans=0;
cin >>n;
int l[200];
int max,tmp;
while(cin>>j){
l[i] = j;
i++;
}
cout<<endl;
for(i=0;i<2*n-1;++i){
max=i;
for(j=i+1;j<2*n;++j){
if(l[max]<l[j]){
max=j;
}
}
tmp=l[max];
l[max]=l[i];
l[i]=tmp;
}
for(i=1;i<2*n;i=i+2){
ans+=l[i];
}
cout<<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> |
s095870176 | p04047 | Runtime Error | kusiyaki = int(input())
kushi = []
for i in range(kusiyaki*2):
kushi.append(int(input()))
kushi = sorted(kushi)
print(sum(kushi[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> |
s500945371 | p04047 | Runtime Error | kusiyaki = int(input('作りたい串焼きの本数を入力してください:'))
kushi = [None] * kusiyaki * 2
i = 0
sum = 0
for kushi_length in kushi:
kushi_length = input('串の長さを入力してください:')
kushi[i] = int(kushi_length)
i += 1
kushi = sorted(kushi)
kushi_min_length = kushi[0:len(kushi):2]
print(kushi)
print(kushi_min_length)
for length in kushi_min_length:
sum += int(length)
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> |
s806014864 | p04047 | Runtime Error | N = int(input())
Llist = sorted(list(map(int, input().split())))[::-1]
ans = 0
for i in range(0, 2*N):
ans += min(Llist[i], Llist[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> |
s887744334 | p04047 | Runtime Error | 5
100 1 2 3 14 15 58 58 58 29
| 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> |
s710307205 | p04047 | Runtime Error | N = int(input())
li = list(map(int, input().split))
li.sort()
P = 0
for i in range(N):
P += li[i*2]
print(P) | 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> |
s993948380 | p04047 | Runtime Error | N = int(input())
L = input().split(' ')
for i in 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> |
s635655531 | p04047 | Runtime Error | n = int(n)
a = list(map(int, input().split()))
a.sort()
ans = 0
for i in range(n):
ans += a[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> |
s004103608 | p04047 | Runtime Error | N=int(input())
L=list(map(int,input().split()))
L.sort()
s=0
for i in range(N):
s+=min(L[2i],L[2i+1])
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> |
s529233422 | p04047 | Runtime Error | a = input()
x = sorted(list(map(int,input().split())))
cnt=0
for i in range(a-1):
cnt += x[2*i]
print(cnt)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s168606739 | p04047 | Runtime Error | a = input()
x = sorted(list(map(int,input().split())))
cnt=0
for i in range(a):
cnt += x[2*i]
print(cnt) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s189986491 | p04047 | Runtime Error | n = int(input())
L = [int(i) for i in input().split()]
L.sort()
ans = 0
for i in range(0, 2*N, 2):
ans += min(L[i], L[i+1])
print(ans) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s197666718 | p04047 | Runtime Error | tN = int(input())
tA = sorted(list(map(int, input().split())))
N = len(tA)
i = 0
total = 0
for x in range(N / 2):
total += min(tA[2 * i], tA[2 * i + 1])
print(total) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s915240495 | p04047 | Runtime Error | tN = int(input())
tA = list(map(int, input().split()))
N = len(tA)
i = 0
total = 0
for x in range(N / 2):
total += min(tA[2 * i], tA[2 * i + 1])
print(total) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s679727884 | p04047 | Runtime Error | x,y=map(int,input().split())
z=3.5*y+x
print(z) | 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> |
s705752314 | p04047 | Runtime Error | from collections import defaultdict
def computeDist(tree, nk, i):
visited = [0] * (nk[0] + 1)
queue = []
visited[i] = 1
queue.append(i)
dist = [0] * (nk[0] + 1)
dist[i] = 0
while queue:
s = queue.pop(0)
for u in tree[s]:
if not visited[u]:
queue.append(u)
visited[u] = 1
dist[u] = dist[s] + 1
return len([i for i in dist if i > nk[1] // 2])
def minimumNodesToBeRemoved(tree, nk):
noOfNodesAtDistKBy2 = [0] * (nk[0] + 1)
for i in range(1, nk[0] + 1):
noOfNodesAtDistKBy2[i] = computeDist(tree, nk, i)
return min(noOfNodesAtDistKBy2[1:])
def start():
nk = [int(i) for i in input().split()]
tree = defaultdict(list)
for i in range(nk[0] - 1):
uv = [int(i) for i in input().split()]
tree[uv[0]].append(uv[1])
tree[uv[1]].append(uv[0])
return minimumNodesToBeRemoved(tree, nk)
print(start()) | 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> |
s220467221 | p04047 | Runtime Error | n = int(input())
L = list(map(int, input().split())
L.sort()
array_L = []
for m in [i * 2 for i in range(n)]:
array_L.append(L[m])
print(sum(array_L))
| 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> |
s077974989 | p04047 | Runtime Error | import numpy as np
cnt = input()
arr = input()
arr = map(int, arr.split(' '))
r = np.array(sorted(arr)[::-1])
print(sum([min(pair) for pair in r.reshape(5,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> |
s040814645 | p04047 | Runtime Error | #座標平面に落とし込んで再帰関数で無理やり計算
# import numpy as np
import sys
sys.setrecursionlimit(10 ** 5)
N, X = map(int, input().split())
if 2 * X > N: #対称性
X = N - X
#座標の作成
dp = [[-1] * (N+3)]
for i in range(N+1):
tmp = [-1]
for j in range(N+1):
if i <= j:
tmp.append(0) #到達していないマス
else:
tmp.append(-1) #壁(範囲外)
tmp.append(-1)
tmp.reverse()
dp.append(tmp)
dp.append([-1] * (N+3))
# print (np.array(dp))
#m: 0:右へ, 1:左下へ, 2:左上へ
def moving(x, y, total, m):
if x == X and y == 1 and dp[x][y] == 1: #一周回ってもとの座標に戻ってきた時
# print ('D')
return total
if m == 0: #右に動く時
tmp = 0
while dp[x-1][y+1] == 0: #右に進める時
dp[x-1][y+1] = 1 #右進んだマスを到達したことにする
tmp += 1
x -= 1
y += 1
if dp[x-1][y+1] == -1: #右側が壁の時-->左下に進む
# print ('1-B')
return moving(x, y, total + tmp, 1)
if dp[x-1][y+1] == 1: #右側が光の線の時-->左上へ進む
tmp += 1
# print ('1-C')
return moving(x-1, y+1, total + tmp, 2)
if m == 1: #左下へ動く時
tmp = 0
while dp[x+1][y] == 0: #左下に進める時
dp[x+1][y] = 1
tmp += 1
x += 1
if dp[x+1][y] == -1: #左下が壁の時-->左上に進む
# print ('2-C')
return moving(x, y, total + tmp, 2)
if dp[x+1][y] == 1: #左下が光の線の時-->左上に進む
tmp += 1
# print ('2-C')
return moving(x+1, y, total + tmp, 2)
if m == 2: #左上に動く時
tmp = 0
while dp[x][y-1] == 0: #左上に進める時
dp[x][y-1] = 1
tmp += 1
y -= 1
if dp[x][y-1] == -1: #左上が壁の時-->右に進む
# print ('3-A')
return moving(x, y, total + tmp, 0)
if dp[x][y-1] == 1: #左上が光の線の時-->左下に進む
tmp += 1
# print ('3-B')
return moving(x, y-1, total + tmp, 1)
X += 1
print (moving(X, 1, 0, 0))
# print (np.array(dp)) | 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> |
s564078703 | p04047 | Runtime Error | N = int(input())
L =[]
for i in range(N*2):
guzai=int(input())
L.append(guzai)
L.sort()
L_even=L[0::2]
goukei=sum(L_even)
print(str(goukei)) | 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> |
s221093562 | p04047 | Runtime Error | N = int(input())
L =[]
guzai=int(input())
L.append(guzai)
L.sort()
L_even=L[0::2]
goukei=sum(L_even)
print(str(goukei))
| 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> |
s484281013 | p04047 | Runtime Error | n = int(input())
l = [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> |
s342698874 | p04047 | Runtime Error | N = int(input())
L = list(map(int, input().split()))
L.sort()
s = 0
for n in range(N):
s += L[2*n}
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> |
s297416464 | p04047 | Runtime Error | N = int(input())
L = list(map(int,input().split())
L.sort()
s = 0
for n in range(N):
s += L[2*n]
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> |
s602627412 | p04047 | Runtime Error | N = input()
L = list(map(int,input().split())
L.sort()
s = 0
for n in range(N):
s += L[2*n]
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> |
s587747630 | p04047 | Runtime Error | N =int( input())
L = list(map(int,input().split())
L.sort
s = 0
for n in range(N):
s += L[2*n]
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> |
s045552452 | p04047 | Runtime Error | N = input()
L = list(map(int,input().split())
L.sort
s = 0
for n in range(N):
s += L[2*n]
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> |
s043187364 | p04047 | Runtime Error | N = int(input())
s = map(int,input().split())
list(s).sort(reverse=True)
sum = 0
for i in range(N):
sum = sum +list(s)[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> |
s292103477 | p04047 | Runtime Error | N = int(input())
s = map(int,input().split())
s.sort()
sum = 0
for i in range(N):
sum = sum + s[2*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> |
s663985852 | p04047 | Runtime Error | N = int(input())
s = map(int,input().split())
s.sort()
sum = 0
for i in range(N):
sum = sum + s[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> |
s359938455 | p04047 | Runtime Error | N = int(input())
s = map(int,input().split())
s.sort(reverse=True)
sum = 0
for i in range(N):
sum = sum + s[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> |
s147710525 | p04047 | Runtime Error | N = int(input())
s = input().split()
s.sort(reverse=True)
sum = 0
for i in range(N):
sum = sum + s[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> |
s454116567 | p04047 | Runtime Error | n=input()
a=input().split()
a=[int(i) for i in a]
a=a.sorted()
count=0
ans=0
for i in a:
if count%2==0:
ans+=i
count+=1 | 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> |
s493625966 | p04047 | Runtime Error | n=int(input());print(sum(sorted(list(map(int,input().split())))[::2]))
print("RE WA?" | 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> |
s238459113 | p04047 | Runtime Error | b=input()
a=int(input().split(" "))
sum=0
for i in a:
sum=sum+i
sum//=2
print(sum) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s007995682 | p04047 | Runtime Error | a=int(input().split())
sum=0
for i in a:
sum=sum+i
sum//=2
print(sum) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s956852856 | p04047 | Runtime Error | N = int(input())
c=list(map(int, input().split()))
c.sort()
Max = 0
for i in range(N):
K = 2*N
Max = Max + c[K]
print(Max)
| 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> |
s320410504 | p04047 | Runtime Error | n = int(input())
s = list(map(int,input().split()))
s.sort()
sum = 0
for i in range(0,2n,2):
sum += s[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> |
s184275577 | p04047 | Runtime Error | def f(a,b):
if a==b:
return 2*a
elif a < b:
return 2*a* + f(a,b-a)
else:
return 2*b + f(a-b,b)
N,X = map(int,input().split(" "))
print(N+f(N-X,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> |
s133312272 | p04047 | Runtime Error | n=int(input())
l=list(map(int,input().split()))
l=set(l)
z=0
for i in range(n):
z+=l[2*i]
print(z)
| 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> |
s857914787 | p04047 | Runtime Error | num = input()
num_list = list(map(int, input().split()))sort()
i = 0
sum = 0
while i < num * 2:
sum += num_list[i]
i += 2
print(sum) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s576295253 | p04047 | Runtime Error | def main():
n,x=map(int,input().split())
a,b=n-x,x
if(a<b):
a,b=b,a
path_length = calc_path(a,b,n)
print(path_length)
def calc_path(a1,b1,c1):
q , mod=divmod(a1,b1)
count=0
if mod==0:
c2=c1+2*b1*q-b1
return c2
else:
count=count+1
c2=c1+2*b1*q
a2=a1-b1*q
b2=b1
if(a2<b2):
a2,b2=b2,a2
return calc_path(a2,b2,c2)
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> |
s947081620 | p04047 | Runtime Error | def main():
n,x=map(int,input().split())
a,b=n-x,x
if(a<b):
a,b=b,a
path_length = calc_path(a,b,n)
print(path_length)
def calc_path(a1,b1,c1):
q , mod=divmod(a1,b1)
count=0
if mod==0:
c2=c1+b1*(q+1)
return c2
else:
count=count+1
c2=c1+b1*(q+1)
a2=a1-b1*q
b2=b1
if(a2<b2):
a2,b2=b2,a2
return calc_path(a2,b2,c2)
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> |
s836937692 | p04047 | Runtime Error | n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
for i in range(0,n/2,2):
ans+=l[i]
print(ans)n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
for i in range([0,]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> |
s040201729 | p04047 | Runtime Error | n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
for i in range(0,n/2,2):
ans+=l[i]
print(ans) | 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> |
s874033754 | p04047 | Runtime Error | n = int(input())
table = list(map(int,input().split()))
table.sort()
count = 0
for i in range(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> |
s142733593 | p04047 | Runtime Error | n = int(input())
table = list(map(int,input().split()))
table.sort()
count = 0
for i in range(1,n+1):
if i%2 = 1:
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> |
s822001572 | p04047 | Runtime Error | #-*- coding: utf-8 -*-
N = int(input())
L_list = [int(input()) for n in range(2N)]
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> |
s617248161 | p04047 | Runtime Error | #-*- coding: utf-8 -*-
N = int(input())
L_list = [int(input()) for n in range(2N)]
L_list.sort()
print(sum(L_list[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> |
s605778442 | p04047 | Runtime Error | from fractionsimport gcd
n,x=map(int,input().split())
print(3*(n-gcd(n,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> |
s631135163 | p04047 | Runtime Error | def tri_len(x,y):
if x== y:
return x
elif x < y:
return tri_len(y-x,x)+2*x
else:
return tri_len(x-y,y)+2*y
import sys
sys.setrecursionlimit(100000)
n,x= list(map(int,input().split(" ")))
print( n+tri_len(x,n-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> |
s396854922 | p04047 | Runtime Error | def tri_len(x,y):
if x== y:
return x
elif x < y:
return tri_len(y-x,x)+2*x
else:
return tri_len(x-y,y)+2*y
import sys
sys.setrecursionlimit(10000)
n,x= list(map(int,input().split(" ")))
print( n+tri_len(x,n-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> |
s559310751 | p04047 | Runtime Error | a = input()
lst = input().split(" ")
lst.sort()
ans=0
for i in range(int(len(lst))):
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> |
s489605749 | p04047 | Runtime Error | #include<bits/stdc++.h>
using namespace std;
int main(){
int N;
cin>>N;
int d=0;
int a[N*2];
for(int i=0;i<N*2;i++){
cin>>a[i];
}
sort(a,a+N);
for(int l=0;l<N*2;l+=2){
d+=a[l];
}
cout<<d<<endl;
} | 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> |
s304691375 | p04047 | Runtime Error | import sys
import numpy as np
N_stick = int(sys.argv[1])
left = [0 for i in range(N_stick)]
right = [0 for i in range(N_stick)]
stuff = [ 0 for i in range(N_stick*2)]
for i in range(N_stick*2):
stuff[i] = sys.argv[i+2]
left = [ int(stuff[2*i]) for i in range(N_stick)]
right = [ int(stuff[2*i+1]) for i in range(N_stick)]
total = left + right
sortedlist = sorted(total)
for i in range(N_stick):
left[i] = sortedlist[2*i]
right[i] = sortedlist[2*i+1]
meat = sum(left)
print(meat) | 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> |
s234847450 | p04047 | Runtime Error | input_word = input()
input_list = input_word.split(" ")
N = int(input_list[0])
K = int(input_list[1])
input_word = input()
tmp_list = input_word.split(" ")
input_list = [ int(i) for i in tmp_list ]
while True:
flag = 0
for i in range(1,N):
number = input_list.index(i)
number_1 = input_list.index(i+1)
if number - number_1 >= K:
input_list[number_1],input_list[number] = input_list[number],input_list[number_1]
flag = 1
break
if flag == 0:
break
for i in input_list:
print(i)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s662189078 | p04047 | Runtime Error | n = int(input())
A = list(map(int, input().split())).sort()
ans = 0
for a, b in zip(A, A[1:]):
ans += a
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> |
s736262531 | p04047 | Runtime Error | 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> |
s445061163 | p04047 | Runtime Error | n=int(input())
l=sorted(list(map(int,iput().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> |
s008080090 | p04047 | Runtime Error | n=int(input())
l=sorted(list(map(int,iput().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> |
s928145687 | p04047 | Runtime Error | n=int(input())
l=[input() for i in range(n)]
l.sort()
s=0
for j in l[::2]:
s+=j
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> |
s592034106 | p04047 | Runtime Error | # -*- coding: utf-8 -*-
N = int(input())
a = [int(input()) for i in range(2*N)]
L = sort(a)
b = []
for i in range(2*N):
b.append(a[2*i])
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> |
s357077322 | p04047 | Runtime Error | # -*- coding: utf-8 -*-
N = int(input())
a = [int(input()) for i in range(2N)]
L = sort(a)
b = []
for i in range(2N):
b.append(a[2*i])
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> |
s316320577 | p04047 | Runtime Error | # -*- coding: utf-8 -*-
N = int(input())
a = [int(input()) for i in range(2N)]
L = sort(a)
b = []
for i in range(2N)
b.append(a[2*i])
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> |
s950638019 | p04047 | Runtime Error | n = int(input())
x = list(map(int, input().split()))
x.sort()
ans = 0
for i range(n):
ans = ans + x[i*2]
print(ans) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s855412902 | p04047 | Runtime Error | n = int(input())
x = list(map(int, input().split()))
x.sort()
ans = 0
for i range(n):
ans = ans + x[i*2]
print(ans)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s638403161 | p04047 | Runtime Error | n= int(input())
x= list(map(int, input().split()))
x.sort()
ans = 0
for i range(n):
ans = ans + x[i*2]
print(ans)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s422829839 | p04047 | Runtime Error | n=int(input())
x=list(map(int, input().split()))
x.sort()
ans = 0
for i range(n):
ans = ans + x[i*2]
print(ans)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s373380643 | p04047 | Runtime Error | n=int(input())
x=list(map(int, input().split()))
x.sort()
ans = 0
for i range(n):
ans = ans + x[i*2]
print(ans)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s712750022 | p04047 | Runtime Error | n=int(input())
x=list(map(int, input().split()))
x.sort()
ans=0
for i range(n):
ans = ans + x[i*2]
print(ans)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s739326319 | p04047 | Runtime Error | n=int(input())
x=list(map(int, input().split()))
x.sort()
ans=0
for i range(n):
ans=ans+x[i*2]
print(ans)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s881546734 | p04047 | Runtime Error | n=int(input())
x=list(map(int, input().split()))
x.sort()
ans=0
for i range(n):
ans=ans+x[i*2]
print(ans)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s634476725 | p04047 | Runtime Error | n=int(input())
x=list(map(int,input().split()))
x.sort()
ans=0
for i range(n):
ans=ans+x[i*2]
print(ans)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s333585563 | p04047 | Runtime Error | n=int(input())
x=list(map(int,input().split()))
x.sort()
ans=0
for i range(n):
ans=+x[i*2]
print(ans)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s529235642 | p04047 | Runtime Error | n=int(input())
x=list(map(int,input().split()))
x.sort()
ans=0
for i range(n):
ans+=x[i*2]
print(ans)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s028269684 | p04047 | Runtime Error | n=int(input())
x=list(map(int,input().split()))
x.sort()
ans=0
for i range(n):
if i%2==1:
pass
else:
ans+=min(x[i],x[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> |
s568274783 | p04047 | Runtime Error | n=int(input())
a=[]
cou=0
for i in range(n*2):
a[i]=int(input())
a.sort()
for i*2 in range(n):
cou+=min(a[i],a[i+1])
print(cou) | 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> |
s382251638 | p04047 | Runtime Error | n = input
l = map(int, input().split())
l = sorted(l)
ans = 0
for i in range(len(n)):
a = l[2*i]
b = l[2*i+1]
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> |
s928614242 | p04047 | Runtime Error | n=int(input())
l=list(map(int,input().split()))
l.sort()
k=l[::2]
print(k.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> |
s595342593 | p04047 | Runtime Error | n = int(input())
l = [int(i) for i in input().split()]
a = 0
for i in len(l):
if i % 2 == 0:
a = a + l[i]
print(a)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s620457516 | p04047 | Runtime Error | N = int(raw_input())
list_input = sorted(map(int, raw_input().split()))
print(sum(list_input[::2])) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s272670636 | p04047 | Runtime Error | N = int(raw_input())
list_input = map(int, raw_input().split())
list_input = sorted(list_input)
sums = 0
for i in range(0,2*N,2):
print(i)
sums += min(list_input[i],list_input[i+1])
print(sums) | 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> |
s974009912 | p04047 | Runtime Error | N = int(raw_input())
list_input = map(int, raw_input().split())
list_input = sorted(list_input)
sums = 0
for i in range(0,2*N,2):
sums += min(list_input[i],list_input[i+1])
print(sums)
| 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> |
s122802468 | p04047 | Runtime Error | N = int(input())
list_input = map(int, raw_input().split())
list_input = sorted(list_input)
sums = 0
for i in range(0,2*N,2):
sums += min(list_input[i],list_input[i+1])
print(sums)
| 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> |
s373040472 | p04047 | Runtime Error | N = input()
list_input = map(int, raw_input().split())
list_input = sorted(list_input)
sums = 0
for i in range(0,2*N,2):
sums += min(list_input[i],list_input[i+1])
print(sums) | 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> |
s565058803 | p04047 | Runtime Error | N = input()
list_input = map(int, raw_input().split())
list_input = sorted(list_input)
sums = 0
for i in range(N,2*N):
sums += list_input[i]
print(sums) | 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> |
s868836591 | p04047 | Runtime Error | n, k = map(int, input().split())
import sys
sys.setrecursionlimit(20000)
l = [[] for i in range(n)]
for i in range(n-1):
a, b = map(int, input().split())
l[a-1].append(b-1)
l[b-1].append(a-1)
def first_search(first, depth):
record = 0
for i in l[first]:
temp = search(first, i, depth-1)
if record < temp:
record = temp
return record + 1
def search(before, now, depth):
if depth <= 0:
return 1
else:
ans = 1
for i in l[now]:
if before != i:
ans += search(now, i, depth-1)
return ans
ret = 0
for i in range(n):
temp = first_search(i, k)
if temp > ret:
ret = temp
if ret > n:
print(0)
else:
print(n-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> |
s331366516 | p04047 | Runtime Error | a = int(input())
b = list(map(int,input().split()))
b.sorted()
su = 0
for i in range(a-1):
su += b[2*i] | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s571583433 | p04047 | Runtime Error | a = int(input())
b = list(map(int,input().split()))
b.sorted()
su = 0
for i in range(a):
su += b[2*i] | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s590942362 | p04047 | Runtime Error | import numpy as np
N, K = map(int, input().split())
E = np.zeros((N, N), dtype=int)
exit(0)
Elist = []
for e in range(N-1):
i, o = map(int, input().split())
Elist.append((i-1, o-1))
E[i-1][o-1] = 1
E[o-1][i-1] = 1
# print("N, K=", N, K)
# for e in Elist:
# print(e[0], e[1])
I = np.eye(N, dtype=int)
# print("I=", I)
ie = I
for k in range(K):
ie = ie + np.matmul(I, E)
# print("I + IE =", ie)
# withinK = np.count_nonzero(ie, axis=0)
withinK = np.zeros(N, dtype=int)
for i in range(N):
for j in range(N):
if ie[i][j] > 0:
withinK[i] += 1
# print("withinK=", withinK)
maxBall = np.amax(withinK)
# print("maxBall=", maxBall)
solution = N - maxBall
print(solution) | 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> |
s439685767 | p04047 | Runtime Error | from collections import deque
N, K = map(int, input().split())
T = [[] for i in range(N)]
E = []
for i in range(N-1):
a, b = map(int, input().split())
a, b = a-1, b-1
T[a].append(b)
T[b].append(a)
E.append((a, b))
def bfs(n):
visited = [False] * N
dist = [0] * N
queue = deque([n])
while queue:
node = queue.pop()
if visited[node]:
continue
visited[node] = True
for n in T[node]:
if not visited[n]:
dist[n] = dist[node] + 1
queue.appendleft(n)
return dist
dist = []
for i in range(N):
dist.append(bfs(i))
ans = float('inf')
if K % 2 == 0:
# 全ての頂点について全探索
for i in range(N):
ans = min(ans, len([d for d in dist[i] if d > K / 2]))
else:
# 全ての辺について全探索
for a, b in E:
adist = [(1 if min(d1, d2) > (K-1) / 2 else 0) for d1, d2 in zip(dist[a], dist[b])]
ans = min(ans, sum(adist))
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> |
s036529572 | p04047 | Runtime Error | N = input()
Li = map(int, input().split(" "))
Li.sort()
total = 0
for i in Li[0::2]
total += i
print(total)
| 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s408828323 | p04047 | Runtime Error | n = int(input())
arr = [map(int,raw_input().split()) for i in range(n)]
count = 0
for i in range(n-1):
for j in range(i+1,n):
s = sum(arr[i]) + sum(arr[j])
comb = s*(s-1)/2
count += comb
print count%(1000000000+7) | 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> |
s830242700 | p04047 | Runtime Error | n = int(input())
print(sum(sorted(map(int, input()))[::2])) | 2
1 3 1 2
| 3
| <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/agc/001/Gg9pvPKw/abbq.png">
<p>Example of a serving of Skewer Meal</p>
</img></div>
<p>He has a stock of <var>2N</var> skewers, all of which will be used in Skewer Meal. The length of the <var>i</var>-th skewer is <var>L_i</var>.
Also, he has an infinite supply of ingredients.</p>
<p>To make a serving of Skewer Meal, he picks <var>2</var> skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be <var>x</var>, then the serving can hold the maximum of <var>x</var> ingredients.</p>
<p>What is the maximum total number of ingredients that his <var>N</var> servings of Skewer Meal can hold, if he uses the skewers optimally?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≦N≦100</var></li>
<li><var>1≦L_i≦100</var></li>
<li>For each <var>i</var>, <var>L_i</var> is an integer.</li>
</ul>
</section>
</div>
<hr/>
<div class="io-style">
<div class="part">
<section>
<h3>Input</h3><p>The input is given from Standard Input in the following format:</p>
<pre><var>N</var>
<var>L_1</var> <var>L_2</var> <var>...</var> <var>L_{2N}</var>
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Output</h3><p>Print the maximum total number of ingredients that Snuke's <var>N</var> servings of Skewer Meal can hold.</p>
</section>
</div>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 1</h3><pre>2
1 3 1 2
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 1</h3><pre>3
</pre>
<p>If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold <var>1</var> and <var>2</var> ingredients, for the total of <var>3</var>.</p>
</section>
</div>
<hr/>
<div class="part">
<section>
<h3>Sample Input 2</h3><pre>5
100 1 2 3 14 15 58 58 58 29
</pre>
</section>
</div>
<div class="part">
<section>
<h3>Sample Output 2</h3><pre>135
</pre></section>
</div>
</span> |
s617678939 | p04047 | Runtime Error | N, X = map(int, intpu().split())
if X <= N / 3:
result = 3 * (N - X)
if N / 3 < X and X < N /2:
result = 6 * X
if N / 2 <= X:
result = 3 * X
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> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.