提出 #807371
ソースコード 拡げる
#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int n = 0;
int ans = 0;
vector <int> skewer;
cin >> n;
for(int buf; ~scanf("%d", &buf);)
{
skewer.push_back(buf);
}
sort(skewer.begin(), skewer.end(), greater<int>());
for(int i = 0; i < n; i++)
{
int s1 = skewer.front();
skewer.erase(skewer.begin());
int s2 = skewer.front();
skewer.erase(skewer.begin());
ans += s2;
}
cout << ans << endl;
return 0;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | A - BBQ Easy |
| ユーザ | Nyhx |
| 言語 | C++14 (GCC 5.4.1) |
| 得点 | 200 |
| コード長 | 711 Byte |
| 結果 | AC |
| 実行時間 | 4 ms |
| メモリ | 256 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 200 / 200 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | sample-01.txt, sample-02.txt |
| All | sample-01.txt, sample-02.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 01-01.txt | AC | 4 ms | 256 KiB |
| 01-02.txt | AC | 4 ms | 256 KiB |
| 01-03.txt | AC | 4 ms | 256 KiB |
| 01-04.txt | AC | 4 ms | 256 KiB |
| 01-05.txt | AC | 4 ms | 256 KiB |
| 01-06.txt | AC | 4 ms | 256 KiB |
| 01-07.txt | AC | 4 ms | 256 KiB |
| 01-08.txt | AC | 4 ms | 256 KiB |
| sample-01.txt | AC | 4 ms | 256 KiB |
| sample-02.txt | AC | 4 ms | 256 KiB |