HDU 1027 Ignatius and the Princess II(求由1-n组成按字典序排序的第m个序列)
来源:互联网 发布:别墅网络布线 ac ap 编辑:程序博客网 时间:2024/06/06 02:47
题目地址:点击打开链接
思路:用STL里的函数即可,暴力换一下也可
AC代码:
#include<iostream>#include<algorithm>using namespace std;int main(){ int m,n,a[1001],i,sum; while(cin>>m>>n) { sum=0; for(i=0;i<m;i++) a[i]=i+1; while(sum<n-1) { next_permutation(a,a+m); sum++; } cout<<a[0]; for(i=1;i<m;i++) { cout<<" "<<a[i]; } cout<<endl; } return 0;}
0 0
- HDU 1027 Ignatius and the Princess II(求由1-n组成按字典序排序的第m个序列)
- HDU 1027 Ignatius and the Princess II【求第M个排列】
- HDU 1027 Ignatius and the Princess II 选择序列题解
- Ignatius and the Princess III(n的m划分)
- 杭电1027 Ignatius and the Princess II 字典序
- 杭电ACM OJ 1027 Ignatius and the Princess II 全排列的第N个 康托展开
- 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
- 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
- Ignatius and the Princess II hdu 1027
- HDU 1027 Ignatius and the Princess II
- 安装若干 VIM 插件(不断更新)
- 了解 Linux內核架構 (1)
- 【数据结构】二叉树的基本操作
- 关于__FILE__,dirname()的使用小小心得
- 简单了解JAVA8的新特性
- HDU 1027 Ignatius and the Princess II(求由1-n组成按字典序排序的第m个序列)
- 25.Oracle数据库SQL开发之 SQLPlus使用——保存、检索并运行文件
- 黑马程序员-----线程
- 物联网操作系统HelloX已成功移植到MinnowBoard MAX开发板上
- netty rpc 框架
- Android分享到微信好友、朋友圈
- 【数据结构】二维数组
- rsync同步工具
- Android工程出现错误Unable to resolve target 'android-19'