# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
746182 | Joibangla | Permutation (APIO22_perm) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
void display(int p[],int k)
{
for(int i=0; i<k; i++){
cout<<p[i];
}
cout<<endl;
void findPermutations(int p[],int k)
{
sort(p,p+k);
cout<<"Possible permutations are:\n";
do{
display(p,k);
}
while(next_permutation(p,p+k));
}
int main()
{
int i=sizeof(p) / sizeof(p[0]);
findpermutations(p,k);
return 0;
}