usingnamespacestd; #define ll long long ll sum = 0; ll a[3 * 123456]; bool(ll x, ll y) { return x > y; } int n; inlinevoid _read(int &x) { x = 0; char t = getchar(); while (!isdigit(t)) t = getchar(); while (isdigit(t)) { x = x * 10 + t - '0'; t = getchar(); } } inlinevoid _read(ll &x) { x = 0; char t = getchar(); while (!isdigit(t)) t = getchar(); while (isdigit(t)) { x = x * 10 + t - '0'; t = getchar(); } } intmain() { _read(n); for (int i = 1; i <= 3 * n; i++) _read(a[i]); int i = 2; sort(a + 1, a + 1 + 3 * n, cmd); while (n--) { sum += a[i]; i += 2; } printf("%lld", sum); return0; }
近期评论