HDU 1027 Ignatius and the Princess II
来源:互联网 发布:电信网络电视多少钱 编辑:程序博客网 时间:2024/05/16 01:56
全排列,next_permutation
#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>#include <math.h>#include <vector>using namespace std;#define sf scanf#define pf printf#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)#define dbg(x) cerr << "Line:" << __LINE__ << " : " << #x << " = " << (x) << endl#define nMax 1000000#define ll long long#define CLR(a) memset((a),0,sizeof((a)))int n,m;int main() {#ifndef ONLINE_JUDGEfreopen("in.txt","r",stdin);#endifwhile(sf("%d%d",&n,&m)==2) {vector<int> a(n);rep(i,n) a[i]=i+1;rep(i,m-1) next_permutation(a.begin(),a.end());rep(i,n) {if(i) pf(" ");pf("%d",a[i]);}pf("\n");}return 0;}
- 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
- 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
- 一步步安装Ubuntu 13.10服务器版
- 给初中语文老师的书法字库软件
- MongoDB相关文章
- 机器学习II. Linear Regression with One Variable (Week 1) 单特征线性回归
- 判断你当前使用的shell程序
- HDU 1027 Ignatius and the Princess II
- poj 1159(回文串dp)
- ubuntu 常用问题解决方法
- POJ 1523 SPF 求割点及对应的连通分量数(入门题)
- C标准I/O库函数与无缓存的I/O函数
- usr/bin/ld: cannot find -lxxx的错误解决办法
- PHP做图书馆借书到期提醒与定时天气预报
- 黑马程序员:Map集合:Hashtable、HashMap、TreeMap介绍
- hdu 4427 Math Magic