Submission #2126373


Source Code Expand

#include<cstdio>

using namespace std;

int N;
int A[300005];

int main(){
	scanf("%d", &N);
	for(int i=0;i<3*N;i++){
		scanf("%d", &A[i]);
	}
	sort(A, A+3*N);
	long long tot = 0;
	for(int i=N;i<2*N;i++){
		tot += (long long)A[i];
	}
	printf("%lld\n", tot);
	return 0;
}

Submission Info

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

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:13:15: error: ‘sort’ was not declared in this scope
  sort(A, A+3*N);
               ^
./Main.cpp:9:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &N);
                 ^
./Main.cpp:11:21: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &A[i]);
                     ^