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
- lower_bound
- 개발일지
- unity
- binary_search
- 시리얼라이제이션
- 백준
- DFS
- 유한상태기계
- 인프런
- fsm
- 웅진씽크빅
- unreal
- 알고리즘
- 이득우
- UI 자동화
- BFS
- 구현
- 안드로이드
- upper_bound
- 언리얼
- c#
- 게임개발
- 이분탐색
- 너비우선탐색
- 게임개발공모전
- 프로그래머스
- 운영체제
- c++
- 재귀
- 유니티
Archives
- Today
- Total
목록타겟 넘버 (1)
초고교급 희망
[프로그래머스][C++] 타겟 넘버
#include #include using namespace std; int answer; void dfs(vector& numbers, int target, int sum, int idx) { if(idx == numbers.size()) { if(sum == target) { answer++; } return; } dfs(numbers, target, sum + numbers[idx], idx + 1); dfs(numbers, target, sum - numbers[idx], idx + 1); } int solution(vector numbers, int target) { dfs(numbers, target, 0, 0); return answer; } 저 이거 10분만에 풀었어염 데헷>.
Algorithm/Programmers
2023. 6. 1. 22:17