Skip to content

Commit 47f42f2

Browse files
authored
BOJ #18110: solved.ac
1 parent e9bd2c7 commit 47f42f2

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

BOJ/18110/Main.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Author: Minho Kim (ISKU)
3+
* Date: December 3, 2019
4+
* E-mail: minho.kim093@gmail.com
5+
*
6+
* https://github.com/ISKU/Algorithm
7+
* https://www.acmicpc.net/problem/18110
8+
*/
9+
10+
import java.io.*;
11+
import java.util.*;
12+
13+
public class Main {
14+
public static void main(String[] args) throws Exception {
15+
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
16+
int N = Integer.parseInt(br.readLine());
17+
int limit = (int) Math.round((N * 15) / 100.0);
18+
19+
int[] array = new int[N];
20+
for (int i = 0; i < N; i++)
21+
array[i] = Integer.parseInt(br.readLine());
22+
Arrays.sort(array);
23+
24+
int sum = 0;
25+
for (int i = limit; i < N - limit; i++)
26+
sum += array[i];
27+
28+
System.out.println((int) Math.round(sum / (N - (limit * 2.0))));
29+
}
30+
}

0 commit comments

Comments
 (0)