Submission #5186515


Source Code Expand

Copy
import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a = new int[n*3];
        for (int i = 0; i < n * 3; i++) {
            a[i] = sc.nextInt();
        }
        Arrays.sort(a);

        long sum = 0;
        for (int i = 0; i < n; i++) {
            sum += a[n+i*2];
        }
        System.out.println(sum);
    }
}

Submission Info

Submission Time
Task A - AtCoder Group Contest
User kusomushi
Language Java8 (OpenJDK 1.8.0)
Score 300
Code Size 496 Byte
Status
Exec Time 748 ms
Memory 92140 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 00_example_01.txt, 00_example_02.txt
All 300 / 300 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 94 ms 19156 KB
00_example_02.txt 106 ms 21712 KB
01.txt 94 ms 19924 KB
02.txt 100 ms 21204 KB
03.txt 96 ms 18772 KB
04.txt 97 ms 19156 KB
05.txt 249 ms 37916 KB
06.txt 662 ms 88768 KB
07.txt 592 ms 89176 KB
08.txt 706 ms 89984 KB
09.txt 748 ms 92140 KB
10.txt 662 ms 89584 KB