티스토리 뷰

https://www.acmicpc.net/problem/18110

 

18110번: solved.ac

5명의 15%는 0.75명으로, 이를 반올림하면 1명이다. 따라서 solved.ac는 가장 높은 난이도 의견과 가장 낮은 난이도 의견을 하나씩 제외하고, {5, 5, 7}에 대한 평균으로 문제 난이도를 결정한다.

www.acmicpc.net

const input = require('fs').readFileSync('./dev/stdin').toString().trim().split('\n').map(Number);
const N = input.shift();
if (N == 0) {
	console.log(0);
	process.exit();
}
const limit = Math.round(N * 0.15);
console.log(
	Math.round(
		input
			.sort((a, b) => a - b)
			.slice(limit, N - limit)
			.reduce((r, v) => r + v, 0) /
			(N - 2 * limit)
	)
);
728x90
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/02   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
글 보관함