Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
58752 | wangwei | 火星人 | C++ | Accepted | 3 MS | 288 KB | 450 | 2024-12-15 16:35:16 |
#include <bits/stdc++.h> using namespace std; int main( ) { int n,m,a[10005]; cin>>n>>m; //火星人N个手指的原始排列顺序 for(int i = 1; i <= n; i ++) cin>>a[i]; //对当前序列进行M次排列 for(int i = 1; i <= m; i ++) next_permutation(a+1,a+n+1); //生成排列M次后的这个排列 for(int i = 1; i <= n; i ++) cout<<a[i]<<" "; return 0; }