题解 | #组队竞赛#
组队竞赛
http://www.nowcoder.com/questionTerminal/6736cc3ffd1444a4a0057dee89be789b
public class Main{
public static void main(String[]args){
Scanner scan=new Scanner(System.in);
while(scan.hasNext()){
int n=scan.nextInt();
int[]arr=new int[3*n];
for(int i=0;i<arr.length;i++){
arr[i]=scan.nextInt();
}
Arrays.sort(arr);
long sum=0;
for(int i=0;i<n;i++){
sum+=arr[arr.length-2*(i+1)];
}
System.out.println(sum);
}
}
}