[20260203] BOJ / G5 / 랭퍼든 수열쟁이야!! / 김민진 #1877
Merged
+60
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🧷 문제 링크
랭퍼든 수열쟁이야!!
🧭 풀이 시간
50분
👀 체감 난이도
✏️ 문제 설명
n까지의 숫자를 두 개씩 가지는 수열이 있음같은 수 사이에는 해당하는 수만큼의 요소가 있어야 함 (e.g. 1 O 1, 2 O O 2, ...)
x번째 인덱스와y번째 인덱스에 들어있는 수가 같을 때 이 조건을 만족하는 수열의 갯수는?🔍 풀이 방법
x와y에는y - x - 1을 넣고 시작n부터 시작해서 재귀 돌림xy에 들어있는 수인 경우 하나 건너뛰기⏳ 회고
어려운거 ㅇㅈ..
큰 수가 채우기 어려운 경우라서 큰 수부터 채우면 분기를 줄일 수 있어서 더 빨리 구할 수 있음