https://www.acmicpc.net/problem/1546
제출한 답안
N = int(input())
scores = []
max = 0
sum = 0
scores = list(map(int, input().split()))
for i in range (N):
if scores[i] > max:
max = scores[i]
for i in range (N):
scores[i] = scores[i] / max * 100
sum += scores[i]
print(sum / N)
타 답안
n = input()
scores = list(map(int, input().split()))
max = max(scores)
sum = sum(scores)
print(sum * 100 / max / int(n))
* 알고리즘 문제를 너무 오랜만에 풀어서 내장함수들을 다 잊어버렸다. .. ㅎ..
차차 내장함수들을 공부하도록 하자.
'python' 카테고리의 다른 글
[백준 11659번] 구간 합 구하기 4 - python (0) | 2025.03.26 |
---|---|
[알고리즘] 구간 합 알고리즘 (0) | 2025.03.26 |
[백준 11720번] 숫자의 합 - python (0) | 2024.11.23 |
[python] 배열과 리스트 (0) | 2024.11.23 |
[백준 2750번] 수 정렬하기 - python (0) | 2024.11.21 |