/**
题目:
链接:
题意:
思路:

*/

#include <iostream>
#include <cstdio>
#include <vector>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
typedef long long LL;
const int mod=1e9+7;
const int maxn=1e2+5;
const double eps = 1e-12;
int main()
{
    int a[5] = {0,1,2,2,3};
    int n = 5;
    sort(a,a+n);
    int cnt = 0;
    do{
        for(int i = 0; i < n; i++){
            printf("%d%s",a[i],i==n-1?"\n":" ");
        }
        cnt++;

    }while(next_permutation(a,a+n));
    cout<<"num = "<<cnt<<endl;/// 5!/2! = 3*4*5 = 60;
    return 0;
}

 

相关文章:

  • 2021-10-30
  • 2021-06-02
  • 2021-10-09
  • 2021-09-27
  • 2021-09-22
  • 2021-10-31
猜你喜欢
  • 2022-12-23
  • 2021-08-30
  • 2022-12-23
  • 2021-08-24
  • 2021-05-11
  • 2021-11-05
相关资源
相似解决方案