Problem_Solving/Binary Search
-
[SWEA] 1245. [S/W 문제해결 응용] 2일차 - 균형점 - Binary SearchProblem_Solving/Binary Search 2019. 2. 6. 16:48
이 글은 SW Expert Academy에 있는 문제를 풀고 정리한 글입니다. https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV15MeBKAOgCFAYD&categoryId=AV15MeBKAOgCFAYD&categoryType=CODE&&& 우선, 가능한 균형점의 위치가 정수가 아닌 실수이기 때문에, 가능한 범위를 모두 탐색해보는건 불가능합니다. 무한히 많은 후보가 존재하기 때문이죠. 이 문제를 읽으면서 제가 괜히 궁금해 졌던건 n-1개의 균형점이 꼭 자성체들 사이의 n-1개의 구간들에 하나씩만 배치 되는가, 즉 두개의 자성체 사이에 두 개 이상의 균형점이 존재할 수 있는가 였습니다. 문제를 읽다보면 자연스럽게 ..