Submission #4265445


Source Code Expand

Copy
//AT2361 AtCoder Group Contest
#include <cstdio>
#include <algorithm>
#include <functional>
#define LL long long
using namespace std;

const int MAXN = 100005;
int a[MAXN*3];

int main()
{
	int n;
	scanf("%d", &n);
	for (register int i = 0; i < 3*n; i++)
		scanf("%d", &a[i]);
	sort(a, a + 3*n);
	int cnt = 0;
	LL tot = 0;
	for (register int i = 1; cnt < n; i += 2)
	{
		tot += (LL)a[i];
//		printf("%d\n", a[i]);
		cnt++;
	}
	printf("%lld", tot);
	return 0;
}

Submission Info

Submission Time
Task A - AtCoder Group Contest
User luogu_bot5
Language C++ (GCC 5.4.1)
Score 0
Code Size 460 Byte
Status
Exec Time 48 ms
Memory 1280 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:14:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &n);
                 ^
./Main.cpp:16:21: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &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 39 ms 1280 KB
07.txt 26 ms 1280 KB
08.txt 48 ms 1280 KB
09.txt 48 ms 1280 KB
10.txt 48 ms 1280 KB