Submission #1194564


Source Code Expand

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int llintcmp(const void *a, const void *b) {
	long long c = *(long long*)a-*(long long*)b;
	if (c>0LL) return -1;
	else if (c==0LL) return 0;
	else return 1;
}

long long a[300010];

int main(void) {
	int i, N;
	long long T=0LL;

	scanf("%d", &N);
	for (i=0;i<3*N;i++) scanf("%lld", &a[i]);

	qsort(a,3*N,sizeof(long long),llintcmp);
	for (i=1;i<=N;i++) T += a[i+1];
	printf("%lld\n", T);	

	return 0;
}

Submission Info

Submission Time
Task A - AtCoder Group Contest
User k_ashiya
Language C (GCC 5.4.1)
Score 0
Code Size 488 Byte
Status WA
Exec Time 74 ms
Memory 4860 KB

Compile Error

./Main.c: In function ‘main’:
./Main.c:18:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &N);
  ^
./Main.c:19:22: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
  for (i=0;i<3*N;i++) scanf("%lld", &a[i]);
                      ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 2
AC × 4
WA × 8
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 0 ms 128 KB
00_example_02.txt AC 0 ms 128 KB
01.txt WA 0 ms 128 KB
02.txt WA 1 ms 128 KB
03.txt WA 1 ms 128 KB
04.txt WA 1 ms 128 KB
05.txt WA 5 ms 508 KB
06.txt AC 50 ms 3708 KB
07.txt AC 37 ms 3708 KB
08.txt WA 74 ms 4860 KB
09.txt WA 74 ms 4860 KB
10.txt WA 74 ms 4860 KB