Submission #3265511
Source Code Expand
import java.util.*; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] box = new int[n]; for (int i = 0; i < n; i++) { box[i] = sc.nextInt(); } int[] ans = new int[n]; for (int i = 0; i < n; i++) { ArrayList<Integer> midBox = new ArrayList<>(); for (int j = 0; j < n; j++) { if (j == i) { continue; } midBox.add(box[j]); } Collections.sort(midBox); ans[i] = midBox.get(n/2 - 1); } for (int i : ans) { System.out.println(i); } } }
Submission Info
Submission Time | |
---|---|
Task | C - Many Medians |
User | kokiBit |
Language | Java8 (OpenJDK 1.8.0) |
Score | 0 |
Code Size | 761 Byte |
Status | TLE |
Exec Time | 2109 ms |
Memory | 239432 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample1.txt, sample2.txt, sample3.txt |
All | sample1.txt, sample2.txt, sample3.txt, 1.txt, 10.txt, 11.txt, 12.txt, 2.txt, 3.txt, 4.txt, 5.txt, 6.txt, 7.txt, 8.txt, 9.txt, sample1.txt, sample2.txt, sample3.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
1.txt | AC | 127 ms | 21844 KB |
10.txt | TLE | 2105 ms | 150732 KB |
11.txt | TLE | 2109 ms | 239432 KB |
12.txt | TLE | 2109 ms | 239252 KB |
2.txt | TLE | 2105 ms | 113004 KB |
3.txt | TLE | 2105 ms | 158272 KB |
4.txt | TLE | 2105 ms | 156512 KB |
5.txt | TLE | 2105 ms | 153932 KB |
6.txt | TLE | 2105 ms | 155732 KB |
7.txt | TLE | 2105 ms | 149584 KB |
8.txt | TLE | 2109 ms | 157192 KB |
9.txt | TLE | 2109 ms | 158640 KB |
sample1.txt | AC | 93 ms | 21844 KB |
sample2.txt | AC | 94 ms | 20820 KB |
sample3.txt | AC | 93 ms | 21844 KB |