Problem Solving/Python
[백준] 1037 - 약수 (python)
TakeKnowledge
2023. 7. 7. 16:19
반응형

1037번: 약수
첫째 줄에 N의 진짜 약수의 개수가 주어진다. 이 개수는 50보다 작거나 같은 자연수이다. 둘째 줄에는 N의 진짜 약수가 주어진다. 1,000,000보다 작거나 같고, 2보다 크거나 같은 자연수이고, 중복되
www.acmicpc.net
포인트
N의 진짜 약수가 모두 주어지고 이 중에 1과 N은 없다는 단서가 있다.
그렇기 때문에 주어지는 약수 중 가장 작은 값과 가장 큰 값을 곱하면 N이 된다. 별 거 없다. 그냥 문제 문장이 이상한 유형..
코드
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n = int(input()) | |
numbers = list(map(int, input().split())) | |
print(min(numbers) * max(numbers)) |
반응형