Contest Duration: ~ (local time) (110 minutes) Back to Home

Submission #6778656

Source Code Expand

Copy
```#include <bits/stdc++.h>
#include <cmath>
#include <numeric>
using namespace std;
using ll=long long;
#define rep(i,a,b) for(int i=(a); i<(b); ++i) // a ≦ i < b
#define Rrep(i,a,b) for(int i=(a);i>=(b);--i) // reverse repeat. a から b まで減少．
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend() //逆イテレータ
// typedef
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef vector<PII> VP;

int main() {
int n;
cin >> n;
VI a(3*n);
rep(i, 0, 3*n) scanf("%d", &a[i]);
sort(ALL(a), greater<int>());

int sum = 0;
rep(i, 0, n){
sum += a[2*i + 1];
}
cout << sum << "\n";
}
```

Submission Info

Submission Time 2019-08-09 10:58:23+0900 A - AtCoder Group Contest miuraKR C++14 (GCC 5.4.1) 0 712 Byte WA 49 ms 1408 KB

Compile Error

```./Main.cpp: In function ‘int main()’:
./Main.cpp:21:35: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
rep(i, 0, 3*n) scanf("%d", &a[i]);
^
```

Judge Result

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 256 KB
00_example_02.txt 1 ms 256 KB
01.txt 1 ms 256 KB
02.txt 1 ms 256 KB
03.txt 1 ms 256 KB
04.txt 1 ms 256 KB
05.txt 4 ms 256 KB
06.txt 41 ms 1408 KB
07.txt 27 ms 1408 KB
08.txt 49 ms 1408 KB
09.txt 49 ms 1408 KB
10.txt 49 ms 1408 KB