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 | 31 |
Tags
- lower_bound
- 개발일지
- 재귀
- c#
- 프로그래머스
- fsm
- unity
- 시리얼라이제이션
- 웅진씽크빅
- unreal
- 인프런
- 운영체제
- 너비우선탐색
- 이분탐색
- c++
- BFS
- 백준
- 유한상태기계
- DFS
- 게임개발
- 게임개발공모전
- UI 자동화
- 알고리즘
- 언리얼
- 이득우
- 유니티
- upper_bound
- 안드로이드
- 구현
- binary_search
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