from collections import Counter
n = int(input())
elements = list(map(int, input().split()))
counter = Counter(elements)
for elem in sorted(counter.keys()):
print(f"{elem} : {counter[elem]}")
답
'정올 > intermediate' 카테고리의 다른 글
정올 4698 그래프 탐색-DFS > Tutorial: for문의 두번째 문법(range_based_for) (1) | 2025.02.05 |
---|---|
정올 4641 분할정복 - Tutorial: Operator Overloading(연산자 오버로딩) (0) | 2025.01.17 |
정올 4524 분할정복 - Tutorial: STL Sort 2 (1) | 2025.01.17 |