일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 언리얼
- 운영체제
- lower_bound
- 재귀
- 유한상태기계
- 안드로이드
- 유니티
- c++
- 알고리즘
- 이득우
- fsm
- 시리얼라이제이션
- 게임개발
- 이분탐색
- 너비우선탐색
- 구현
- upper_bound
- 게임개발공모전
- binary_search
- 웅진씽크빅
- 백준
- 인프런
- BFS
- UI 자동화
- 프로그래머스
- c#
- 개발일지
- DFS
- unity
- unreal
- Today
- Total
목록Algorithm/Programmers (5)
초고교급 희망
안녕하세요. 날씨가 쌀쌀하니 귤의 계절이 돌아왔네요. 그래서 프로그래머스 귤 고르기를 풀어보았습니다. 🍊문제 https://school.programmers.co.kr/learn/courses/30/lessons/138476 🐼문제 설명 경화는 과수원에서 귤을 수확했습니다. 경화는 수확한 귤 중 'k'개를 골라 상자 하나에 담아 판매하려고 합니다. 그런데 수확한 귤의 크기가 일정하지 않아 보기에 좋지 않다고 생각한 경화는 귤을 크기별로 분류했을 때 서로 다른 종류의 수를 최소화하고 싶습니다. 예를 들어, 경화가 수확한 귤 8개의 크기가 [1, 3, 2, 5, 4, 5, 2, 3] 이라고 합시다. 경화가 귤 6개를 판매하고 싶다면, 크기가 1, 4인 귤을 제외한 여섯 개의 귤을 상자에 담으면, 귤의 크기의..
#include #include using namespace std; vector solution(int brown, int yellow) { vector answer; int area = brown + yellow; for(int i = 3; i
#include #include using namespace std; int solution(vector maps) { int n = maps.size(); int m = maps[0].size(); vector dist(n, vector(m, -1)); dist[0][0]= 1; queue q; q.push({0, 0}); int dx[4] = {-1, 0, 1, 0}; int dy[4] = {0, 1, 0, -1}; while(!q.empty()) { int x = q.front().first; int y = q.front().second; q.pop(); for(int i = 0; i = 0 &&..
#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분만에 풀었어염 데헷>.
#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 연습!!