Submission #1454281


Source Code Expand

#include <cstdio>
#include <algorithm>
using namespace std;

int n;
long long a[300005];
int main() {
	scanf("%d", &n);
	for (int i = 1; i <= 3 * n; i++) {
		scanf("%I64d", &a[i]);
	}
	sort(a + 1, a + (3 * n) + 1);//
	long long ans = 0;
	for (int i = n + 1; i <= 3 * n; i += 2) {
		ans += a[i];
	}
	printf("%I64d", ans);
}

Submission Info

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

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:10:23: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘long long int*’ [-Wformat=]
   scanf("%I64d", &a[i]);
                       ^
./Main.cpp:17:21: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
  printf("%I64d", ans);
                     ^
./Main.cpp:8:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &n);
                 ^
./Main.cpp:10:24: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%I64d", &a[i]);
                        ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 1
WA × 1
AC × 5
WA × 7
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 1 ms 128 KB
00_example_02.txt WA 0 ms 128 KB
01.txt AC 1 ms 128 KB
02.txt WA 1 ms 128 KB
03.txt AC 1 ms 128 KB
04.txt AC 1 ms 128 KB
05.txt WA 9 ms 256 KB
06.txt WA 82 ms 2560 KB
07.txt AC 57 ms 2560 KB
08.txt WA 132 ms 2560 KB
09.txt WA 132 ms 2560 KB
10.txt WA 131 ms 2560 KB