https://www.acmicpc.net/problem/23278
1
2
3
4
|
n,l,h=map(int, input().split())
scores=sorted(list(map(int, input().split())))
ans=sum(scores[l:n-h])/(n-l-h)
print(ans)
|
cs |
점수들이 최대 100이하고 숫자들 개수가 엄청 많았다면 계수정렬을 썼겠지만
그렇지 않으므로 내부함수를 사용해도 됩니다~
If scores's scope is under 100,
The number of scores is a lot of.. Maybe I use Counting sort
But in this problem I can use internal sort() function
반응형
'python-algorithm' 카테고리의 다른 글
백준 2535 아시아 정보올림피아드 (0) | 2022.10.18 |
---|---|
백준 20124 모르고리즘 회장님 추천 받습니다 (0) | 2022.10.17 |
백준 25496 장신구 명장 임스 (0) | 2022.10.17 |
백준 1251 단어 나누기 (0) | 2022.10.17 |
백준 17335 APC는 왜 서브태스크 대회가 되었을까? (0) | 2022.10.14 |
댓글