#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. 《C# 爬虫 破境之道》:第一境 爬虫原理 — 第四节:同步与异步请求方式

    前两节,我们对WebRequest和WebResponse这两个类做了介绍,但两者还相对独立.本节,我们来说说如何将两者结合起来,方式有哪些,有什么不同. 1.4.1 说结合,无非就是我们如何发送一个 ...

  2. 关于neo4j初入门(4)

    关于admin管理员 数据库备份和恢复 Neo4j数据库备份 步骤1 -点击“Neo4j Community”,如下图所示 Windows“开始”按钮>> "All Progra ...

  3. 9.Java三大版本以及JDK,JRE,JVM简单介绍

    Write Once,Run Anywhere. JavaSE:标准版(桌面程序,控制台开发...),是Java的基础和核心. JavaME:嵌入式开发(手机,小家电...),现在基本不用已经过时. ...

  4. 「 深入浅出 」集合List

    第一篇文章 「 深入浅出 」java集合Collection和Map 主要讲了对集合的整体介绍,本篇文章主要讲List相对于Collection新增的一些重要功能以及其重要子类ArrayList.Li ...

  5. 【Oracle】复制表结构和表数据

    1.既复制表结构也复制表数据:CREATE TABLE tab_new AS SELECT * FROM tab_old; 2.只复制表结构:CREATE TABLE tab_new AS SELEC ...

  6. Xen+OpenQRM快速部署

    一.选择系统平台 a)   Ubuntu-11.10-server-amd64 二.Xen安装 a)   Xen安装 # apt-get -y install xen-hypervisor-4.1-a ...

  7. linux下误清用户/home下的文件怎么办?

    2016-08-19 10:38:10   有时候我们不小心把home目录下的用户目录删除了,出现上图情况,每行开头直接变成-bash-3.2$这种形式而不是[lyp@centos7 ~]$这种,这时 ...

  8. UML类图的情话诉说

    你知道吗这个世界是个繁杂而又简单的世界 你我在冥冥中都有联系 有时候,你像我的妈妈一样,对你依赖满满, 没有你我不知道何去何从(依赖) 有时候,看你,真如我亲爱孩子般,想一直拥你入我怀抱,但我知道终究 ...

  9. sys model 常见用法

    import sys #与python解释器 交互 print(sys.argv) #是一个列表 解释器执行文件名后面可以增加字符串 以列表元素形式添加进去def foo(): print('ok') ...

  10. 如何更改cmd 编码为UTF-8

    如何将cmd编码改为UTF—8 如图输入chcp 65001即可更改 改完之后是这样的 更改回GBK 输入 CHCP 936即可