티스토리챌린지 (20) 썸네일형 리스트형 [Leetcode 3254번 문제] 3254. Find the Power of K-Size Subarrays I. 문제 상황You are given an array of integers nums of length n and a positive integer k.The power of an array is defined as:Its maximum element if all of its elements are consecutive and sorted in ascending order.1 otherwise.You need to find the power of all subarrays of nums of size k.Return an integer array results of size n - k + 1, where results[i] is the power of nums[i..(i + k - 1)].i 번째부터 i + k.. [백준 14451번 문제] 안대 낀 스피드러너 문제 상황문제가 되는 파트의 난이도 자체가 높은 것은 아니다. 장애물이 격자 형태로 놓여 있고, 왼쪽 아래에서 출발해서 오른쪽 위로 가면 되는 간단한 파트다. 심지어 이 장애물도 게임을 킬 때마다 랜덤으로 배치되는 게 아니라 위치가 고정되어 있다. 문제는 처음에 어느 방향으로 서 있는지가 랜덤이라는 것이다. 안대를 꼈으니 방향을 알 방법이 없다.N×N 격자가 있고, 2≤N≤20이다. 몇몇 칸에는 거대한 장애물이 있어서 지나갈 수 없고, 나머지는 비어 있어서 자유롭게 지나갈 수 있다. 격자 외부도 벽으로 둘러싸여 있어서 밖으로 나갈 수 없다. 주인공은 처음에 왼쪽 아래에 있고, 어느 방향으로 서 있는지는 모르지만 위와 오른쪽 중 하나인 것은 확실하다. 주인공은 매초 "전진", "좌회전", "우회전" 중 하.. [C++] WCHAR, TCHAR, cstring 정리 이런 것에 대한 정보를 담고 있다WCHAR과 TCHAR이 무엇인지가변길이 문자열 vs 고정 길이 문자열cstring string의 차이WCHAR 문자열 만드는법.이런 것에 대한 정보는 담겨있지 않다1. WCHAR과 TCHAR이 무엇인지우선 WCHAR은 wind-character 이라고 하는 문자이다. 일반적으로 문자는 1바이트라고 배운다. 0부터 127까지의 비트로 문자를 구분해놓은 아스키(ASCII)가 대표적인 1바이트 문자이다. 그럼 당연히 wide string이라는건 2바이트 이상의 문자열을 의미하겠다 라고 생각할 수 있다.그렇다면 TCHAR은 무엇일까 TCHAR은 1바이트 문자 CHAR과 2바이트 문자 WCHAR을 통일해서 쓰기 위해 만들어졌다. 유니코드를 사용하는 경우 TCHAR은 2바이트 문자.. [Leetcode 2955번 문제] 2955. Number of Same-End Substrings 문제 상황You are given a 0-indexed string s, and a 2D array of integers queries, where queries[i] = [li, ri] indicates a substring of s starting from the index li and ending at the index ri (both inclusive), i.e. s[li..ri].각각의 쿼리가 subarrayReturn an array ans where ans[i] is the number of same-end substrings of queries[i].same-end?A 0-indexed string t of length n is called same-end if it has the same.. [Leetcode 2064번 문제] 2064. Minimized Maximum of Products Distributed to Any Store 문제 상황You are given an integer n indicating there are n specialty retail stores. There are m product types of varying amounts, which are given as a 0-indexed integer array quantities, where quantities[i] represents the number of products of the ith product type.You need to distribute all products to the retail stores following these rules:A store can only be given at most one product type but can.. [오픈소스/srs] 1. 오픈소스 도커 디버깅 기본 환경 설정 이런 것에 대한 정보를 담고 있다오픈소스 SRS에서 권장하는 방식으로 도커로 디버깅 준비 하는 법VSCode를 통해 Docker 안에서 디버깅을 하는 법오픈소스 기여를 하기위해 이슈를 고르는 법이런 것에 대한 정보는 담겨있지 않다vs코드 remote ssh 사용법1. 오픈소스 SRS 기여를 위한 디버그 환경 설치개발자가되면 계속해서 하고 싶었던 오픈소스 기여를 하기위해 하고있는 일들을 블로그로 적으려고한다. 일단 프로젝트는 SRS라는 미디어 서버를 선택했다. 미디어 자체에 관심이있고 많이 해보고 싶다 보니 고르게 됐고. 나름 규모있는 프로젝트여서 초보자가 들어가기 위한 가이드같은게 마련되어있어서 고른 것도 있었다. SRS는 프로젝트 적으로 도커에서 실행하는 것을 권장하는 특징이 있었다. 난 처음에 여기부.. [Leetcode 465번 문제] 465. Optimal Account Balancing 문제 상황You are given an array of transactions transactions where transactions[i] = [fromi, toi, amounti] indicates that the person with ID = fromi gave amounti $ to the person with ID = toi.Return the minimum number of transactions required to settle the debt.transactions 배열이 주어진다 각 요소는 a부터, b까지 c만큼 라는 뜻, a, b 는 ID고 c는 달러다.debt를 내지 않기 위해서 필요한 가장 작은 transaction의 수를 구하여라Input: transactions = [[0,1,1.. [Leetcode 2601번 문제] 2601. Prime Subtraction Operation 문제 상황You are given a 0-indexed integer array nums of length n.You can perform the following operation as many times as you want:Pick an index i that you haven’t picked before, and pick a prime p strictly less than nums[i], then subtract p from nums[i].Return true if you can make nums a strictly increasing array using the above operation and false otherwise.A strictly increasing array is an array.. 이전 1 2 3 다음