Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- 이분탐색
- 구현
- binary_search
- lower_bound
- 게임개발
- 유니티
- unity
- 재귀
- unreal
- fsm
- 프로그래머스
- 인프런
- 이득우
- 웅진씽크빅
- 운영체제
- 게임개발공모전
- upper_bound
- 시리얼라이제이션
- DFS
- c#
- 너비우선탐색
- 유한상태기계
- UI 자동화
- 언리얼
- BFS
- 안드로이드
- 백준
- c++
- 개발일지
- 알고리즘
Archives
- Today
- Total
목록삼총사 (1)
초고교급 희망
[프로그래머스][C++]삼총사
#include #include using namespace std; int answer = 0; void dfs(vector& numbers, int sum, int cnt, int index) { if(cnt == 3) { if(sum == 0) { answer++; } return; } for(int i = index; i < numbers.size(); i++) { dfs(numbers, sum + numbers[i], cnt + 1, i + 1); } } int solution(vector number) { for(int i = 0; i < number.size(); i++) { dfs(number, number[i], 1, i + 1); } return answer; } DFS 연습!!
Algorithm/Programmers
2023. 6. 1. 18:09