hdu 1027 Ignatius and the Princess II
2013-07-14 22:04
411 查看
之前不用stl,代码敲了n久。。。。
不得不说,stl真是个好东西,有了它,很多步骤都能方便很多了
不得不说,stl真是个好东西,有了它,很多步骤都能方便很多了
#include<stdio.h> #include<string.h> #include<algorithm> using namespace std; int ans[10005]; int main() { int n,m,i; while(scanf("%d%d",&n,&m)!=-1) { for(i=0;i<n;i++)ans[i]=i+1; while(--m) next_permutation(ans,ans+n); printf("%d",ans[0]); for(i=1;i<n;i++) printf(" %d",ans[i]); printf("\n"); } return 0; }
相关文章推荐
- hdu 1027 Ignatius and the Princess II【dfs 排列组合】
- HDU 1027 Ignatius and the Princess II
- HDU 1027 Ignatius and the Princess II
- hdu 1027 Ignatius and the Princess II
- 全排列算法 HDU - 1027 Ignatius and the Princess II
- HDU 1027 Ignatius and the Princess II (STL全排列)
- HDU 1027 Ignatius and the Princess II(全排列)
- Ignatius and the Princess II hdu 1027
- HDU 1027 Ignatius and the Princess II
- HDU 1027 Ignatius and the Princess II (next_permutation)
- HDU 1027 - Ignatius and the Princess II
- Ignatius and the Princess II (HDU 1027) ——next_permutation排列函数
- 【STL】hdu 1027 Ignatius and the Princess II
- HDU 1027 Ignatius and the Princess II
- HDU 1027.Ignatius and the Princess II【全排列】【数学】【1月3】
- HDU 1027 Ignatius and the Princess II
- 【HDU 1027 Ignatius and the Princess II】+ 全排列 + STL
- hdu 1027 Ignatius and the Princess II(产生第m大的排列,next_permutation函数)
- [HDU] 1027 Ignatius and the Princess II
- HDU 1027 Ignatius and the Princess II