초기화 할 때 fill 을 사용해야 확실하게 초기화 할 수 있다.경우의 수를 나눈 다음 재귀를 활용해 풀이했다.#include #include using namespace std;int arr[1000001] ;int div(int input){ if(arr[input] == -1) { if(input % 6 == 0) { arr[input] = min({div(input-1), div(input/3), div(input/2)}) + 1; } else if (input % 3 == 0) { arr[input] = min({div(input-1), div(input/3)}) + 1; ..