Submission #6250288


Source Code Expand

Copy
#include<stdio.h>
#include<algorithm>
#include<functional>
#include<cmath>
using namespace std;
long long  mod = 1000000007;
long long a[300000];
int main()
{
	int N;
	long long sum = 0;
	scanf("%d", &N);
	for (int i = 0; i < N * 3; i++) {
		scanf("%lld", &a[i]);
	}
	sort(a, a + N * 3, greater<long long>());
	for (int i = N; i < N*2; i++) {
		sum += a[i];
	}
	printf("%lld", sum);
	return 0;
}

Submission Info

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

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:12:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &N);
                 ^
./Main.cpp:14:23: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%lld", &a[i]);
                       ^

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 128 KB
00_example_02.txt 1 ms 128 KB
01.txt 1 ms 128 KB
02.txt 1 ms 128 KB
03.txt 1 ms 128 KB
04.txt 1 ms 128 KB
05.txt 3 ms 256 KB
06.txt 40 ms 2560 KB
07.txt 27 ms 2560 KB
08.txt 48 ms 2560 KB
09.txt 48 ms 2560 KB
10.txt 48 ms 2560 KB