hdu 1027 next_permutation()
2016-08-23 17:04
323 查看
题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=1027
#include<iostream> #include<algorithm> using namespace std; int main() { int m,n; int a[10001]; while(cin>>n>>m) { int i; for(i=1;i<=n;i++) a[i]=i; int j=0; while(next_permutation(a+1,a+n+1)) { j++; if(j==m-1) { for(int k=1;k<n;k++) cout<<a[k]<<" "; cout<<a <<endl; break; } } } return 0; }
相关文章推荐
- 全排列next_permutation的用法 HDU 1027 PKU 3187 1146 1731
- HDU 1027 Ignatius and the Princess II 【next_permutation(a,a+n)的应用】
- HDU-1027 组合数 STL-next_permutation
- next_permutation & prev_permutation & hdu 1027 Ignatius and the Princess II
- HDU 1027 Ignatius and the Princess II(stl,next_permutation)
- HDU 1027 Ignatius and the Princess II (产生第m大的排列,STLmap中的next_permutation(array,array+n);)
- HDU 1027 Ignatius and the Princess II(next_permutation()的应用)
- hdu_1027(好吧。。。牛。。。next_permutation也可以水过)
- hdu 1027 输出第m个全排列(next_permutation)
- HDU 1027--Ignatius and the Princess II【next_permutation】
- Ignatius and the Princess II (HDU 1027) ——next_permutation排列函数
- hdu 1027 STL next_permutation
- HDU 1027 Ignatius and the Princess II (next_permutation)
- HDU 1027 STL中next_permutation的应用
- hdu--1027-next_permutation||dfs
- hdu 1027 hdu 1716 (next_permutation的使用)
- C++标准库:<algorithm>next_permutation() HDU - 1027
- HDU 1027 Ignatius and the Princess II【STL- next_permutation全拍列】
- hdu 1027 全排列函数next_permutation运用
- HDU 1755--A Number Puzzle【next_permutation】