티스토리 뷰
728x90
https://www.acmicpc.net/problem/20937
20937번: 떡국
Naver D2를 아시나요? D2는 For Developers, By Developers의 약자로, 개발자들을 위해 개발자들이 직접 만들어 가고 있는 네이버 개발자 지원 프로그램입니다. 네이버가 축적한 기술과 지식을 공유하고, 외
www.acmicpc.net
- 문제 :

- 풀이 :
내림차순으로 정렬한 떡국의 사이즈들 중 가장 큰 값을 출력하면 된다.
- 소스코드 :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
import sys
from collections import Counter
input = sys.stdin.readline
if __name__ == "__main__":
N = int(input())
size = sorted(list(map(int,input().split())), reverse = True)
ans = 0
check = Counter(size)
for i in check:
if ans < check[i]:
ans = check[i]
print(ans)
|
cs |
320x100
'Algorithm > Implementation' 카테고리의 다른 글
(Python) - BOJ(1063번) : 킹 (0) | 2022.02.20 |
---|---|
(Python) - BOJ(21737번) : SMUPC 계산기 (0) | 2022.02.17 |
(Python) - BOJ(20044번) : Project Teams (0) | 2022.02.16 |
(Python) - BOJ(19939번) : 박 터뜨리기 (0) | 2022.02.16 |
(Python) - BOJ(12845번) : 모두의 마블 (0) | 2022.02.09 |
© 2022 WonSeok, All rights reserved