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
- binary_search
- fsm
- UI 자동화
- 언리얼
- unity
- 유한상태기계
- 시리얼라이제이션
- lower_bound
- 재귀
- 게임개발공모전
- unreal
- 운영체제
- 이득우
- 백준
- 게임개발
- 알고리즘
- 구현
- BFS
- 인프런
- c#
- upper_bound
- DFS
- 프로그래머스
- 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