728x90 반응형 15686치킨배달1 22-04-18-15686-치킨배달 01.dfs 방식 1 void dfs(int idx, int count) { if (idx > chicken.size()) return; if (count == M) { int dis = absDistance(); ret = ret > dis ? dis : ret; return; } D.push_back(idx); dfs(idx + 1, count + 1); D.pop_back(); dfs(idx + 1, count); } 02.dfs 방식 2 void dfs(int idx, int count) { if (count == M) { int dis = absDistance(); ret = ret > dis ? dis : ret; return; } for (int i = idx; i < chicken.size.. 2022. 4. 18. 이전 1 다음 728x90 반응형