순열, 조합은 정말정말 많이 나오는데 cpp의 stl 라이브러리 중 next_permutation으로 구할 수 있다. 하지만 next_permutation은 N이 20만 넘어가도 터질 위험에 처한다.. 시간복잡도가 크기 때문이다. N이 10 언저리일때 쓰면 좋다. 재귀를 사용하여 DFS탐색을 통해 순열, 조합을 구하는 것이 가장 안전하고 깔끔하다.순열 구하기#include #include #include #define MAX 5 using namespace std; vectorarr; vectorresult; int visit[MAX]; /* 순열 구하기 */ void prt_permu() { for (int i = 0; i < result.size(); i++) { cout