Submission #1308340
Source Code Expand
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define rrep(i, n) for (int i = (n)-1; i >= 0; --i)
#define rrep2(i, a, b) for (int i = (a)-1; i >= b; --i)
#define range(i, a, b, c) for (int i = a; \
c > 0 ? i < b : i > b; \
i += c)
#define chmax(a, b) (a = (a) < (b) ? (b) : (a))
#define chmin(a, b) (a = (a) > (b) ? (b) : (a))
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define all(a) begin(a), end(a)
#define ifnot(a) if (not(a))
#define dump(x) cerr << #x << " = " << (x) << endl
#define int long long
#ifdef _MSC_VER
const bool test = true;
#else
const bool test = false;
#endif
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
const int INF = (int)1 << 60;
const ll INFL = (ll)1 << 60;
ll mod_n = (int)1e9 + 7;
const double eps = 1e-10;
typedef long double Real;
// return -1, 0, 1
int sgn(const Real &r) { return (r > eps) - (r < -eps); }
int sgn(const Real &a, const Real &b) { return sgn(a - b); }
//.....................
const int MAX = (int)2e5 + 5;
vector<string> split(const string &str, char sep)
{
vector<string> v;
stringstream ss(str);
string buffer;
while (getline(ss, buffer, sep))
{
v.push_back(buffer);
}
return v;
}
template <class InputIterator>
int sum(InputIterator begin, InputIterator end)
{
return accumulate(begin, end, 0ll);
}
void solve();
signed main()
{
cout << fixed << setprecision(20);
solve();
while (true)
{
char s[MAX];
if (scanf("%s", s) == EOF)
break;
int n = strlen(s);
for (int i = n - 1; i > -1; i--)
{
ungetc(s[i], stdin);
}
solve();
}
return 0;
}
int n;
int a[3 * MAX];
void solve() {
cin >> n;
rep(i, 3 * n) cin >> a[i];
sort(a, a + 3 * n);
rep(i, 3 * n) cerr << a[i] << " ";
cerr << endl;
int res = 0;
rep(i, n) {
cerr << a[3 * n - 2 - 2 * i] << " ";
res += a[3 * n - 2 - 2 * i];
}
cerr << endl;
cout << res << endl;
}
Submission Info
Submission Time |
|
Task |
A - AtCoder Group Contest |
User |
naimonon77 |
Language |
C++14 (GCC 5.4.1) |
Score |
300 |
Code Size |
2343 Byte |
Status |
AC |
Exec Time |
447 ms |
Memory |
4352 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 |
27 ms |
384 KB |
06.txt |
AC |
447 ms |
4352 KB |
07.txt |
AC |
366 ms |
4352 KB |
08.txt |
AC |
413 ms |
4352 KB |
09.txt |
AC |
427 ms |
4352 KB |
10.txt |
AC |
413 ms |
4352 KB |