Submission #1195308


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int) (n); i++)
#define pb push_back
#define mp make_pair
#define maximize(a, b) ((a)<(b)?(a)=(b),1:0)
#define minimize(a, b) ((a)>(b)?(a)=(b),1:0)
void MAIN();
int main() {
//    freopen("input.txt", "r", stdin);

    MAIN();
    return 0;
}

const int N = 100032;
int n, a[N];

void MAIN() {
    scanf("%d", &n);
    REP(i, 3*n) scanf("%d", a+i);
    sort(a, a+3*n);
    long long ans = 0;
    REP(i, n) {
        ans += a[3*n - i*2 - 2];
    }
    cout << ans << endl;
}

Submission Info

Submission Time
Task A - AtCoder Group Contest
User minh141198
Language C++14 (GCC 5.4.1)
Score 0
Code Size 586 Byte
Status RE
Exec Time 122 ms
Memory 640 KB

Compile Error

./Main.cpp: In function ‘void MAIN()’:
./Main.cpp:20:20: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &n);
                    ^
./Main.cpp:21:33: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     REP(i, 3*n) scanf("%d", a+i);
                                 ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 2
AC × 7
WA × 2
RE × 3
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 4 ms 256 KB
06.txt RE 122 ms 640 KB
07.txt WA 9 ms 640 KB
08.txt RE 106 ms 640 KB
09.txt WA 11 ms 640 KB
10.txt RE 108 ms 640 KB