본문 바로가기
python-algorithm

백준 23278 영화 평가

by 무적김두칠 2022. 10. 17.

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

 

23278번: 영화 평가

스타트링크에는 영화 감상 동아리가 있다. 영화 동아리에는 총 N명의 구성원이 있고, 매주 모여서 영화 한 편을 본다. 영화를 본 뒤, 각 사람은 0보다 크거나 같고, 100보다 작거나 같은 정수로 영

www.acmicpc.net

 

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

 

반응형

댓글