标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 6701 Accepted Submission(s):
3964
#include<cstdio> #include<cstring> #include<algorithm> #include<iostream> using namespace std; int a[1005]; int main() { int n,m; while(scanf("%d%d",&n,&m)!=EOF) { for(int i=0;i<n;i++) a[i]=i+1; m--; while(m--) { next_permutation(a,a+n); } for(int i=0;i<n;i++) { if(i!=n-1) printf("%d ",a[i]); else printf("%d\n",a[i]); } } return 0; }
HDU_1027_Ignatius and the Princess II_全排列
标签:
原文地址:http://www.cnblogs.com/jasonlixuetao/p/5532462.html