Skip to content

[BOJ 1940] 주몽 - #4

Merged
sh0723 merged 1 commit into
mainfrom
solve-boj1940
May 22, 2026
Merged

[BOJ 1940] 주몽#4
sh0723 merged 1 commit into
mainfrom
solve-boj1940

Conversation

@sh0723

@sh0723 sh0723 commented May 22, 2026

Copy link
Copy Markdown
Owner

풀이 요약

  • 주어진 재료 번호 중 서로 다른 두 재료를 골라 합이 M이 되는 조합의 개수를 센다.
  • V1은 이중 반복문으로 모든 (i, j) 쌍을 확인하며, i < j만 검사해 같은 조합을 중복 계산하지 않는다.
  • V2는 재귀 함수로 길이 2의 조합을 만들고, 선택한 두 값의 합이 목표값과 같으면 카운트를 증가시킨다.
  • 두 풀이 모두 조합을 직접 탐색하는 방식이며 시간 복잡도는 O(N^2), 추가 공간은 V1 기준 O(N), V2 기준 입력 배열과 재귀 선택 배열을 포함해 O(N)이다.

Notion

https://www.notion.so/1940-368efc7388e380458832e1a19e9473d7

문제

  • BOJ 1940
  • 제목: 주몽

Closes #3

@sh0723
sh0723 merged commit b609c02 into main May 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BOJ 1940] 주몽

1 participant