标签:http io os ar for sp 2014 on amp
题目链接:POJ 1833
/************************************ * author : Grant Yuan * time : 2014/10/19 16:38 * source : POJ 1833 * algorithm: STL+排列的生成 *************************************/ #include <iostream> #include <algorithm> #include <cstdio> #include <cstring> #include <cmath> using namespace std; int str[1030]; int ans[1030]; int n,k,t; int main() { scanf("%d",&t); while(t--){ memset(str,0,sizeof(str)); scanf("%d%d",&n,&k); for(int i=0;i<n;i++) { scanf("%d",&str[i]); } for(int i=1;i<=k;i++) { bool b=next_permutation(str,str+n); } for(int j=0;j<n;j++) { if(j!=n-1) printf("%d ",str[j]); else printf("%d\n",str[j]); } } return 0; }
标签:http io os ar for sp 2014 on amp
原文地址:http://blog.csdn.net/yuanchang_best/article/details/40263831