Skip to content

Commit ca720d4

Browse files
committed
[D2] Title: [S/W 문제해결 기본] 1일차 - 최빈수 구하기, Time: 65 ms, Memory: 53,760 KB -BaekjoonHub
1 parent 5685dc2 commit ca720d4

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# [D2] [S/W 문제해결 기본] 1일차 - 최빈수 구하기 - 1204
2+
3+
[문제 링크](https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV13zo1KAAACFAYh)
4+
5+
### 성능 요약
6+
7+
메모리: 53,760 KB, 시간: 65 ms, 코드길이: 355 Bytes
8+
9+
### 제출 일자
10+
11+
2025-05-24 11:40
12+
13+
14+
15+
> 출처: SW Expert Academy, https://swexpertacademy.com/main/code/problem/problemList.do
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
T = int(input())
2+
3+
for tc in range(1, T+1):
4+
N = int(input())
5+
nums = list(map(int, input().split()))
6+
7+
nums.sort(reverse=True)
8+
9+
dic = {}
10+
11+
for i in nums:
12+
if i not in dic:
13+
dic[i] = 1
14+
else:
15+
dic[i] += 1
16+
dic = sorted(dic.items(), key=lambda x: x[1], reverse=True)
17+
print(f"#{tc} {dic[0][0]}")

0 commit comments

Comments
 (0)