Submission #42345368


Source Code Expand

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt();
			Map<Integer, List<Integer>> result = new HashMap<>();
			for (int i = 1; i <= 3 * n; i++) {
				int value = scanner.nextInt();
				List<Integer> list = result.computeIfAbsent(value, k -> new ArrayList<>());
				list.add(i);
			}

			result.entrySet().stream()
					.map(entry -> Map.entry(entry.getKey(), entry.getValue().get(1)))
					.sorted(Map.Entry.comparingByValue())
					.map(Map.Entry::getKey)
					.forEach(value -> System.out.print(value + " "));
		}
	}
}

Submission Info

Submission Time
Task C - Centers
User kmatsu
Language Java (OpenJDK 11.0.6)
Score 250
Code Size 762 Byte
Status AC
Exec Time 1295 ms
Memory 84200 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 250 / 250
Status
AC × 3
AC × 19
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 144 ms 38524 KiB
00_sample_01.txt AC 134 ms 38640 KiB
00_sample_02.txt AC 140 ms 38744 KiB
01_random_00.txt AC 803 ms 69004 KiB
01_random_01.txt AC 468 ms 61252 KiB
01_random_02.txt AC 419 ms 58584 KiB
01_random_03.txt AC 821 ms 68648 KiB
01_random_04.txt AC 617 ms 65996 KiB
01_random_05.txt AC 787 ms 68544 KiB
01_random_06.txt AC 771 ms 68208 KiB
01_random_07.txt AC 1295 ms 82748 KiB
01_random_08.txt AC 1273 ms 82372 KiB
01_random_09.txt AC 1251 ms 84200 KiB
01_random_10.txt AC 948 ms 73080 KiB
01_random_11.txt AC 1282 ms 82920 KiB
01_random_12.txt AC 1275 ms 83296 KiB
01_random_13.txt AC 1165 ms 77496 KiB
01_random_14.txt AC 1097 ms 80064 KiB
01_random_15.txt AC 1175 ms 83484 KiB