Submission #2865605
Source Code Expand
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(); long[] X = new long[N]; long[] s = new long[N]; for(int i=0;i<N;i++) { long cur = sc.nextLong(); X[i]=cur; s[i]=cur; } Arrays.sort(s); long smaller = s[N/2-1]; long bigger = s[N/2+1]; for(int i=0;i<N;i++){ long ans; if(X[i]<=smaller) ans=bigger; else ans = smaller; System.out.println(ans); } } }
Submission Info
Submission Time | |
---|---|
Task | C - Many Medians |
User | AlbertZ |
Language | Java8 (OpenJDK 1.8.0) |
Score | 0 |
Code Size | 682 Byte |
Status | RE |
Exec Time | 1544 ms |
Memory | 86712 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 | WA | 106 ms | 19788 KB |
10.txt | WA | 1438 ms | 82936 KB |
11.txt | AC | 1398 ms | 80316 KB |
12.txt | AC | 1178 ms | 65916 KB |
2.txt | WA | 1144 ms | 70304 KB |
3.txt | WA | 1475 ms | 83208 KB |
4.txt | WA | 1484 ms | 74908 KB |
5.txt | WA | 1544 ms | 86712 KB |
6.txt | WA | 1484 ms | 78892 KB |
7.txt | WA | 1369 ms | 76804 KB |
8.txt | WA | 1470 ms | 81596 KB |
9.txt | WA | 1500 ms | 85184 KB |
sample1.txt | AC | 92 ms | 21716 KB |
sample2.txt | RE | 94 ms | 19540 KB |
sample3.txt | WA | 93 ms | 20820 KB |