Submission #5171715


Source Code Expand

Copy
#include<bits/stdc++.h>
#define F first
#define S second
#define MP make_pair
#define pb push_back
#define endl '\n'

using namespace std;

typedef long long LL;
typedef pair< int, int > P;
typedef pair< LL, LL > LP;
typedef pair< int, P > iP;
typedef pair< P, P > PP;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1000000007;
static const int SIZE = 300015;

int dx[] = {0, -1, 1, 0};
int dy[] = {-1, 0, 0, 1};

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    LL n;
    cin >> n;
    LL a[SIZE];
    for( int i = 0; i < n * 3; ++i ) {
        cin >> a[i];

    }
    sort( a, a + ( n * 3 ), greater< LL >() );
    
    LL res = 0;
    for( int i = n; i < n * 2; ++i ) res += a[i];
    cout << res << endl;
    return 0;
}

Submission Info

Submission Time
Task A - AtCoder Group Contest
User crom
Language C++14 (GCC 5.4.1)
Score 0
Code Size 901 Byte
Status
Exec Time 45 ms
Memory 2560 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 00_example_01.txt, 00_example_02.txt
All 0 / 300 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 1 ms 256 KB
00_example_02.txt 1 ms 256 KB
01.txt 1 ms 256 KB
02.txt 1 ms 256 KB
03.txt 1 ms 256 KB
04.txt 1 ms 256 KB
05.txt 4 ms 384 KB
06.txt 35 ms 2560 KB
07.txt 22 ms 2560 KB
08.txt 45 ms 2560 KB
09.txt 45 ms 2560 KB
10.txt 45 ms 2560 KB