Submission #1454276
Source Code Expand
#include <cstdio> #include <algorithm> using namespace std; int n, a[300005]; int main() { scanf("%d", &n); for (int i = 1; i <= 3 * n; i++) { scanf("%d", &a[i]); } sort(a + 1, a + 3 * n + 1); long long ans = 0; for (int i = n + 1; i <= 3 * n - 1; i += 2) { ans += a[i]; } printf("%I64d", ans); }
Submission Info
Submission Time | |
---|---|
Task | A - AtCoder Group Contest |
User | rlawhdgus |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 325 Byte |
Status | WA |
Exec Time | 48 ms |
Memory | 1280 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:16:21: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=] printf("%I64d", ans); ^ ./Main.cpp:7:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &n); ^ ./Main.cpp:9:21: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &a[i]); ^
Judge Result
Set Name | Sample | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||||||
Status |
|
|
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 | 1 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 | 3 ms | 256 KB |
06.txt | WA | 39 ms | 1280 KB |
07.txt | AC | 26 ms | 1280 KB |
08.txt | WA | 48 ms | 1280 KB |
09.txt | WA | 48 ms | 1280 KB |
10.txt | WA | 48 ms | 1280 KB |