일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 백준
- 실습
- 모각코
- 최소스패닝트리
- 알고리즘
- 마라마라빔
- 종합설계
- Bellman-Ford
- codetree
- 코드트리
- django
- minimum spanning tree
- DP
- 함밥
- 백트래킹
- Kruskal
- DFS
- SQL
- MyPlaylist
- 장고
- 동적계획법
- 그리디알고리즘
- BFS
- B대면노래방
- 프로그래머스
- 파이썬
- 소프트웨어공학
- Planned
- programmers
- 데이터베이스
Archives
- Today
- Total
Leta Learns
[Python] Intermediate Low - Basic #최대 최소 본문
# 최대 최소
- n개의 숫자 중 최소 https://www.codetree.ai/missions/2/concepts/1/problems/min-of-n-num/description
n = int(input())
arr = list(map(int, input().split()))
min1 = min(arr)
print(min(arr), arr.count(min1))
- n개의 숫자 중 최대 2개 https://www.codetree.ai/missions/2/concepts/1/problems/two-max-of-n-num/description
n = int(input())
arr = list(map(int, input().split()))
arr.sort(reverse=True)
print(arr[0], arr[1])
- 중복되지 않는 숫자 중 최대 https://www.codetree.ai/missions/2/concepts/1/problems/max-of-unique-number/description
n = int(input())
arr = list(map(int, input().split()))
count = 0
not_dup = []
for i in arr:
if arr.count(i) == 1:
count += 1
not_dup.append(i)
if count != 0:
print(max(not_dup))
else:
print(-1)
'Coding > codetree' 카테고리의 다른 글
[Python] Intermediate Low - DP (0) | 2021.08.13 |
---|---|
[Python] Intermediate Low - DFS , BFS (0) | 2021.08.11 |
[Python] Intermediate Low - Basic #단순 반복문 (0) | 2021.08.03 |
Comments