#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<iostream>

using namespace std;

#define ll long long
#define N 110000
int s[N];
int main(void)
{
int n, m;

while(scanf("%d%d", &n, &m) != EOF)
{
for(int i = 0; i < n; i++)
s[i] = i + 1;

int t = 1;

int flag = 0;

while(next_permutation(s, s + n))
{
if(flag == 1)
break;

t++;

if(t == m)
{
flag = 1;

for(int i = 0; i < n; i++)
{
if(i != 0 )
printf(" ");

printf("%d", s[i]);
}

}
}

printf("\n");

}

return 0;

}

HDU Ignatius and the Princess II 全排列下第K大数的更多相关文章

  1. HDU - 1027 Ignatius and the Princess II 全排列

    Ignatius and the Princess II Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K ( ...

  2. poj 1027 Ignatius and the Princess II全排列

    Ignatius and the Princess II Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K ( ...

  3. hdu Ignatius and the Princess II

    Ignatius and the Princess II Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Ja ...

  4. HDU 1027 Ignatius and the Princess II(求第m个全排列)

    传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1027 Ignatius and the Princess II Time Limit: 2000/10 ...

  5. (全排列)Ignatius and the Princess II -- HDU -- 1027

    链接: http://acm.hdu.edu.cn/showproblem.php?pid=1027 Ignatius and the Princess II Time Limit: 2000/100 ...

  6. HDU 1027 Ignatius and the Princess II[DFS/全排列函数next_permutation]

    Ignatius and the Princess II Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K ( ...

  7. Ignatius and the Princess II(全排列)

    Ignatius and the Princess II Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K ( ...

  8. hdu1027 Ignatius and the Princess II (全排列 &amp; STL中的神器)

    转载请注明出处:http://blog.csdn.net/u012860063 题目链接:http://acm.hdu.edu.cn/showproblem.php? pid=1027 Ignatiu ...

  9. HDU 1027 Ignatius and the Princess II(康托逆展开)

    Ignatius and the Princess II Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K ( ...

随机推荐

  1. 两个大数相乘 - 高精度FFT

    HDU 1402 A * B Problem Plus Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (J ...

  2. spark和strom优劣分析

    对于Storm来说:1.建议在那种需要纯实时,不能忍受1秒以上延迟的场景下使用,比如实时金融系统,要求纯实时进行金融交易和分析2.此外,如果对于实时计算的功能中,要求可靠的事务机制和可靠性机制,即数据 ...

  3. 「 深入浅出 」集合Set

    系列文章 「 深入浅出 」集合List 「 深入浅出 」java集合Collection和Map Set继承自Collection接口,不能包含有重复元素.本篇文章主要讲Set中三个比较重要的实现类: ...

  4. linux 的21个命令:

    1:ls  [list] 2:输入输出重定向 3:| 管道 4:chmod 5:cd 6:mkdir 7:cp 8:rm 9:mv 10:cat 11:pwd 12:ln[link] 13:grep ...

  5. 以其他控制器为目标 在视图中生成输出URL

    结果呢:<a href="/Admin">This targets another controller</a>

  6. Ubuntu下配置Apache以及搭载CGI

    在Windows下自己下载应用过Apache,在Linux下也用到了服务器,就选择了Apache.Apache的安装在Ubuntu下异常简单. 1. 上网下载自动包安装 sudo apt-get in ...

  7. 超越队西柚考勤系统——beta冲刺3

    一.成员列表 姓名 学号 蔡玉蓝(组长) 201731024205 郑雪 201731024207 何玉姣 201731024209 王春兰 201731024211 二.SCRUM部分 (1)各成员 ...

  8. CentOS7 zabbix4.0搭建配置

    一.Zabbix-Server服务器端的安装 概述:10050是Agent的端口,Agent采用被动方式,Server主动连接Agent的10050端口:10051是Server的端口,Agent采用 ...

  9. openresty http

    openresty http openresty默认没有提供http客户端,需要第三方提供插件. 下载方式: wget https://raw.githubusercontent.com/pintsi ...

  10. python基础[1]——python运算符&python数据类型之数值型

    python常用运算符&数字&布尔值 上节回顾 一.变量名和标识符 变量名的命名规范 (1)只能包含数字,字母和下划线 (2)只能以字母和下划线开头(不能以数字开头) (3)标识符是区 ...