python/백준 - 18110번 문제에 대한 분석임.
import sys; input = sys.stdin.readline
from collections import deque
def round(num):
return int(num) + (1 if num-int(num)>= 0.5 else 0)
n = int(input())
l = [int(input()) for _ in range(n)]
l.sort()
l = deque(l)
per = round(n*0.15)
if n>per*2:
for i in range(per):
l.popleft()
l.pop()
print(round(sum(l)/len(l)))
else:
print(0)
def round(num):
return int(num) + (1 if num-int(num)>= 0.5 else 0)
round(n.5) 이와 같은 경우 n에서 가장 가까운 짝수를 반환하게 된다.
if two multiples are equally close,
rounding is done toward the even choice
(so, for example, both round(0.5) and round(-0.5) are 0,
and round(1.5) is 2)

n = int(input())
l = [int(input()) for _ in range(n)]
l.sort()
l = deque(l)
per = round(n*0.15)
if n>per*2:
for i in range(per):
l.popleft()
l.pop()
print(round(sum(l)/len(l)))
else:
print(0)
n을 통해 상위/하위 몇 명을 제외 해야하는지 수를 구해준다.0을 반환해준다.