Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: skibidisigma
Problemset: ค่าแปลกๆ
Language: python
Time: 1.567 second
Submitted On: 2026-05-28 15:24:36
n = int(input())
num = list(map(int,input().split()))
avg = sum(num) / n
ans = num[0]
for x in num:
if num.count(x)<num.count(ans):
ans = x
elif num.count(x) == num.count(ans):
if abs(x-avg) > abs(ans-avg):
ans = x
print(ans)