목록2024/03/05 (2)
넘치게 채우기
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/eAIfhq/btsFygaMA4O/SsLRXBwsRVKoG0UPbynuPK/img.png)
이전 장에서 다음 방정식의 모든 자연 수 해를 찾는 방법을 제시하였다: 이 등식의 양번을 c^2로 나누면 다음과 같다: 즉, 유리수 쌍 (a/c, b/c)는 다음 방정식의 해가 된다: 이는 (0, 0)을 중심으로 하는 단위원 C이다. 단위원 C의 기하적 성질을 이용하여 C위의 점들 중에서 xy좌표가 모두 유리수인 점을 찾아보자. 우선, (1, 0), (-1, 0), (0, 1), (0, -1)이 있다. 이 중에서 점 (-1, 0)을 지나고 기울기가 m인 직선 L을 생각해보자. 직선 L의 방정식은 다음과 같다: 원과 직선의 교점은 두 개이고, 하나는 (-1, 0)이다. 위의 두 식의 연립방정식을 풀면, 아래와 같다: 위 공식에 m=v/u를 대입하면 . 피타고라스 세 수를 얻을 수 있다.
https://leetcode.com/problems/minimum-length-of-string-after-deleting-similar-ends/description/ Minimum Length of String After Deleting Similar Ends - LeetCode Can you solve this real interview question? Minimum Length of String After Deleting Similar Ends - Given a string s consisting only of characters 'a', 'b', and 'c'. You are asked to apply the following algorithm on the string any number o..