목록2024/03 (38)
넘치게 채우기
![](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..
피타고라스 세 수 (a, b, c)를 만족하는 자연수는 무한히 많은가? 답은 "그렇다"이다. 하나의 피타고라스 세 수(a, b, c)가 있다면, 적당한 수 d를 곱해보자. (da, db, dc)도 피타고라스 수가 된다. 원시 피타고라스 세 수(Primitive Ptyhagorean triple, PPT) 원시 피타고라스 세 수는 공약수를 가지지 않고, 를 만족하는 세 자연수 a, b, c이다. 예시) 3, 4, 5 5, 12, 13 8, 15, 17 7, 24, 25 20, 21, 29 ... a와 b중 하나는 짝수, 하나는 홀수이다. 또한, c는 항상 홀수인 것 같다. 이를 증명해보자. 증명) a와 b가 모두 짝수라고 하면, c도 짝수이다. 세 수 모두 짝수이면, 공약수가 2가 되므로 모두 짝수가 될 ..
수론이란, 자연수라 불리는 양의 정수의 집합에 대한 연구이다. 수론, 수학에서 필요한 문제풀이 과정 자료를 모아라. 보통 자료는 수치적이지만 추상적인 경우도 있다. 모은 자료를 조사하고 규칙성과 관련성을 찾아보아라. 규칙성 및 관련성을 설명하는 추측(conjecture)을 만들어보아라. 이런 추측은 보통 공식으로 나타낼 수 있다. 추가 자료를 모으고 새로운 정보가 추측에 부합하는지 확인하여 추측을 검증하여라. 추측이 참으로 보일 방법(증명)을 고안하라.
https://leetcode.com/problems/bag-of-tokens/description/ Leetcode - Bag of Tokens 문제 유형 : 그리디, 투포인터, 정렬 문제 난이도 : Medium 문제 You start with an initial power of power, an initial score of 0, and a bag of tokens given as an integer array tokens, where each tokens[i] donates the value of tokeni. Your goal is to maximize the total score by strategically playing these tokens. In one move, you can play ..
https://leetcode.com/problems/remove-nth-node-from-end-of-list/description/ Remove Nth Node From End of List - LeetCode Can you solve this real interview question? Remove Nth Node From End of List - Given the head of a linked list, remove the nth node from the end of the list and return its head. Example 1: [https://assets.leetcode.com/uploads/2020/10/03/remove_ex1.jpg] leetcode.com Leetcode - R..
https://leetcode.com/problems/squares-of-a-sorted-array/description/ Squares of a Sorted Array - LeetCode Can you solve this real interview question? Squares of a Sorted Array - Given an integer array nums sorted in non-decreasing order, return an array of the squares of each number sorted in non-decreasing order. Example 1: Input: nums = [-4,-1,0,3,10] Out leetcode.com Leetcode - Squares of a S..
https://leetcode.com/problems/maximum-odd-binary-number/description/ Maximum Odd Binary Number - LeetCode Can you solve this real interview question? Maximum Odd Binary Number - Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com Leetcode - Maximum Odd Binary Number 문제 유형 : 문자열처리, 비트마스킹, 그리디 문제..