Submission #1886645
Source Code Expand
#include <iostream> #include <sstream> #include <iomanip> #include <cstdio> #include <cstdlib> #include <cmath> #include <cctype> #include <cstring> #include <vector> #include <list> #include <queue> #include <deque> #include <stack> #include <map> #include <set> #include <algorithm> #include <iterator> #include <bitset> #include <ctime> using namespace std; #define FOR(i,a,b) for (int i = (a); i < (b); i++) #define RFOR(i,b,a) for (int i = (b)-1; i >= (a); i--) #define ITER(it,a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++) #define FILL(a,value) memset(a, value, sizeof(a)) #define SZ(a) (int)a.size() #define ALL(a) a.begin(), a.end() #define PB push_back #define MP make_pair typedef long long LL; typedef vector<int> VI; typedef pair<int, int> PII; const double PI = acos(-1.0); const int INF = 1000 * 1000 * 1000 + 7; const LL LINF = INF * (LL) INF; const int MAX = 4 * 100 * 1000 + 47; const double EPS = 1e-8; int A[MAX]; int main() { int n; cin >> n; FOR(i, 0, 3 * n)cin >> A[i]; sort(A, A + 3 *n); LL ans = 0; reverse(A, A+3*n); FOR(i, 0, n) { //cout << A[2 * i + 1] << endl; ans += A[2 * i + 1]; } cout << ans << endl; }
Submission Info
Submission Time | |
---|---|
Task | A - AtCoder Group Contest |
User | vjudge3 |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 1257 Byte |
Status | AC |
Exec Time | 174 ms |
Memory | 1408 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 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 | 256 KB |
00_example_02.txt | AC | 1 ms | 256 KB |
01.txt | AC | 1 ms | 256 KB |
02.txt | AC | 1 ms | 256 KB |
03.txt | AC | 1 ms | 256 KB |
04.txt | AC | 1 ms | 256 KB |
05.txt | AC | 9 ms | 256 KB |
06.txt | AC | 174 ms | 1408 KB |
07.txt | AC | 57 ms | 1408 KB |
08.txt | AC | 125 ms | 1408 KB |
09.txt | AC | 127 ms | 1408 KB |
10.txt | AC | 125 ms | 1408 KB |