Create 백준1761번(정점들의거리).java#26
Open
syslians wants to merge 3 commits into
Hidden character warning
The head ref may contain hidden characters: "syslian5\uc8fc\ucc28"
Open
Conversation
마찬가지로 조합 문제. 사전의 단어는 길이 1~5의 모든 조합을 사전순으로 나열한 것.
각 단어의 인덱스를 계산하려면, word보다 사전순으로 앞에 오는 단어 수를 세고, word 자체를 포함해 +1.
각 자리에서 선택 가능한 문자(A, E, I, O, U)를 고려해, 특정 단어의 위치를 수학적으로 계산. 가중치 배열 weights = {781, 156, 31, 6, 1}은 각 자리(0~4, 즉 길이 1~5의 단어)에서 뒤에 올 수 있는 단어 수를 나타냄.
순열 조합 문제로 보입니다. 순서가 중요하지 않으므로 (a, b , c) 와 (a, c, b)는 동일합니다. 배열길이 nn < 13, 3개를 선택하는 조합수는 최대 286. 완전탐색 또한 무리 없기에 3중 루프를 사용했습니다. 재귀풀이보다 오히려 직관적이라 생각합니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
메모리. 시간 모두 초과 !