'14888 연산자 끼워넣기' 태그의 글 목록
22-04-11-14888-연산자끼워넣기
01.dfs를 이용한 계산 void dfs(int idx, int plus, int minus, int multiple, int divide, int sum) { if (idx == sumNumber) { minNumber = minNumber > sum ? sum : minNumber; maxNumber = maxNumber < sum ? sum : maxNumber; return; } if (plus) dfs(idx + 1, plus - 1, minus, multiple, divide, sum + number[idx+1]); if (minus) dfs(idx + 1, plus, minus-1, multiple, divide, sum - number[idx + 1]); if (multiple) dfs(..
2022. 4. 12.