小编kyo*_*ong的帖子

使用/不使用 std::next_permutation 进行重复排列“不改变重复项的顺序”

我曾经使用 来实现重复排列std::next_permutation

但我发现 it( std::next_permutation) 改变了重复项目的位置。

e.g.
[0] 0 1 2 2'
[1] 2' 0 1 2
[2] 2' 1 0 2
[3] 2' 1 2 0 
...
Run Code Online (Sandbox Code Playgroud)

如何使用重复实现排列而不改变重复项的顺序(使用/不使用)std::next_permutation

e.g.
[0] 0 1 2 2'
[1] 1 0 2 2'
[2] 1 2 0 2'
[3] 1 2 2' 0
...
Run Code Online (Sandbox Code Playgroud)

c++ permutation std

9
推荐指数
1
解决办法
443
查看次数

标签 统计

c++ ×1

permutation ×1

std ×1