Submission #1194654


Source Code Expand

Copy
#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;

int main()
{
	int N;
	cin >> N;
	vector<int> a(3 * N);
	for (int i = 0; i < 3 * N; i++) cin >> a[i];
	long long ans = 0;
	sort(a.begin(), a.end());
	int index = 3 * N - 2;
	for (int i = 0; i < N; i++) {
		ans += a[index];
		index -= 2;
	}
	cout << ans << endl;

Submission Info

Submission Time
Task A - AtCoder Group Contest
User tokumini
Language C++14 (GCC 5.4.1)
Score 0
Code Size 392 Byte
Status

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:21:21: error: expected ‘}’ at end of input
  cout << ans << endl;
                     ^