Submission #1194622


Source Code Expand

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
using namespace std;

#define ll long long
#define INF (1 << 30)
#define INFLL (1LL << 60)

#define FOR(i,a,b) for(ll i = (a);i<(b);i++)
#define REP(i,a) FOR(i,0,(a))
#define MP make_pair

vector<ll> a;

int main() {
    ll n;
    cin >> n;
    REP(i, 3*n) {
        int t;
        cin >> t;
        a.push_back(t);
    }

    sort(a.begin(),a.end(),greater<int>());

    ll ans = 0;
    for (int i = 1; i < 2 * n; i+=2) {
        ans += a[i];
    }

    cout << ans << endl;

    return 0;
}

Submission Info

Submission Time
Task A - AtCoder Group Contest
User ytwtnb
Language C++14 (GCC 5.4.1)
Score 300
Code Size 751 Byte
Status AC
Exec Time 176 ms
Memory 6256 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 2
AC × 12
Set Name Test Cases
Sample 00_example_01.txt, 00_example_02.txt
All 00_example_01.txt, 00_example_02.txt, 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt
Case Name Status Exec Time Memory
00_example_01.txt AC 1 ms 256 KB
00_example_02.txt AC 1 ms 256 KB
01.txt AC 1 ms 256 KB
02.txt AC 1 ms 256 KB
03.txt AC 1 ms 256 KB
04.txt AC 1 ms 256 KB
05.txt AC 9 ms 640 KB
06.txt AC 176 ms 4720 KB
07.txt AC 60 ms 5104 KB
08.txt AC 127 ms 6128 KB
09.txt AC 127 ms 4848 KB
10.txt AC 129 ms 6256 KB