- 火星人
- 2016-08-28 14:33:20 @
呵呵
1 条评论
-
lrj124 LV 10 @ 2016-08-28 17:01:20
#include <algorithm> #include <iostream> using namespace std; //ifstream cin("martian.in",ios :: in); //ofstream cout("martian.out",ios :: out); int n,m,a[10001]; int main() { ios :: sync_with_stdio(false); cin >> n >> m; for (int i = 1;i <= n;i++) cin >> a[i]; while (m--) next_permutation(a+1,a+n+1); for (int i = 1;i <= n;i++) cout << a[i] << ' '; return 0; }
- 1