Submission #1194956


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;

int main(){
  int N;
  long long X=0;
  cin >> N;
  int a[3*N];
  for (int i=0;i<3*N;i++){
    cin >> a[i];
  }
  sort(a.rbegin(),a.rend());
  for(int i=0;i<N;i++){
    X+=a[i*2];
  }
  cout << X << endl;
  return 0;
}

Submission Info

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

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:12:10: error: request for member ‘rbegin’ in ‘a’, which is of non-class type ‘int [(N * 3)]’
   sort(a.rbegin(),a.rend());
          ^
./Main.cpp:12:21: error: request for member ‘rend’ in ‘a’, which is of non-class type ‘int [(N * 3)]’
   sort(a.rbegin(),a.rend());
                     ^