next_permutation

C++

std::next_permutation() 사용법 정리

std::next_permutation() 입력받은 원소의 다음 순열을 구함 다음 순열이 존재하면 true, 존재하지 않으면 false를 반환 $ {}_n \mathrm{P}_n $ 순열 출력 #include #include #define N 4 int main(void) { int arr[N] = { 1, 2, 3, 4 }; do { for (int i = 0; i < N; i++) { std::cout

Park Joonyoung
'next_permutation' 태그의 글 목록