Skip to content

Instantly share code, notes, and snippets.

@ateruimashin
Created May 28, 2020 21:59
Show Gist options
  • Save ateruimashin/df072d9d7c8988e8433f4ed8f9eba50a to your computer and use it in GitHub Desktop.
Save ateruimashin/df072d9d7c8988e8433f4ed8f9eba50a to your computer and use it in GitHub Desktop.
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i,s,n) for(int i = (s); i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main(){
int n;
cin >> n;
int a[3 * n];
rep(i, 3 * n) cin >> a[i];
sort(a, a + 3 * n);
ll ans = 0;
for(int i = n; i < 3 * n;i+=2)
ans += a[i];
cout << ans << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment