반응형
목록 파이썬 세용액 (1)
KEEP GOING

https://www.acmicpc.net/problem/2473 2473번: 세 용액 첫째 줄에는 전체 용액의 수 N이 입력된다. N은 3 이상 5,000 이하의 정수이다. 둘째 줄에는 용액의 특성값을 나타내는 N개의 정수가 빈칸을 사이에 두고 주어진다. 이 수들은 모두 -1,000,000,000 이상 www.acmicpc.net [투포인터] n = int(input()) lst = sorted(map(int, input().split())) liquid = 4*(10**9) answer = [] for i in range(n-1): start, end = i+1, n-1 while start < end: total = lst[i] + lst[start] + lst[end] if abs(total) <..
code review/study
2022. 5. 27. 13:56