ps | |
---|---|
링크 | acmicpc.net/… |
출처 | BOJ |
문제 번호 | 15460 |
문제명 | My Cow Ate My Homework |
레벨 | 실버 2 |
시간복잡도 | O(n) |
인풋사이즈 | n<=100,000 |
사용한 언어 | Python 3.11 |
제출기록 | 41316KB / 108ms |
최고기록 | 108ms |
해결날짜 | 2023/07/24 |
"""Solution code for "BOJ 15460. My Cow Ate My Homework".
- Problem link: https://www.acmicpc.net/problem/15460
- Solution link: http://www.teferi.net/ps/problems/boj/15460
"""
INF = float('inf')
def main():
N = int(input())
scores = [int(x) for x in input().split()]
lowest = total = scores[-1]
score_by_k = [-INF] * N
for count, score in enumerate(scores[-2:0:-1], start=2):
lowest = min(lowest, score)
total += score
score_by_k[N - count] = (total - lowest) / (count - 1)
max_score = max(score_by_k)
print(*(k for k, score in enumerate(score_by_k) if score == max_score))
if __name__ == '__main__':
main()