全排列函数解法

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
using namespace std;
typedef long long ll; char s[];
int main()
{
int len;
scanf("%s", s);
len=strlen(s);
sort(s,s+len);
do
{
puts(s);
}while(next_permutation(s, s+len));
return ;
}

51Nod - 1384的更多相关文章

  1. 51Nod - 1384 正常解法

    这个是正常解法 #include<stdio.h> #include<string.h> #include<math.h> #include<time.h&g ...

  2. 51Nod 1384 全排列

    给出一个字符串S(可能有重复的字符),按照字典序从小到大,输出S包括的字符组成的所有排列.例如:S = "1312", 输出为:   1123 1132 1213 1231 131 ...

  3. 51nod 1384:全排列(STL)

    题目链接 记住next_permutation函数的用法,另外string在这里比char[]慢好多啊.. //#include<bits/stdc++.h> //using namesp ...

  4. 51nod 1384 可重集的全排列

    对于1231,121,111等有重复的数据,我们怎么做到生成全排列呢 实际上,对于打标记再释放标记的这种方法,如果一开始第一层递归访问过1那么你再访问 就会完全重复上一次1开头的情况,那么递归地考虑这 ...

  5. 【51Nod 1244】莫比乌斯函数之和

    http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1244 模板题... 杜教筛和基于质因子分解的筛法都写了一下模板. 杜教筛 ...

  6. 51Nod 1268 和为K的组合

    51Nod  1268  和为K的组合 1268 和为K的组合 基准时间限制:1 秒 空间限制:131072 KB 分值: 20 难度:3级算法题 给出N个正整数组成的数组A,求能否从中选出若干个,使 ...

  7. 51Nod 1428 活动安排问题

    51Nod   1428  活动安排问题 Link: http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1428 1428 活 ...

  8. 51Nod 1278 相离的圆

    51Nod 1278 相离的圆 Link: http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1278 1278 相离的圆 基 ...

  9. 【51Nod 1501】【算法马拉松 19D】石头剪刀布威力加强版

    http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1501 dp求出环状不连续的前缀和,剩下东西都可以算出来,比较繁琐. 时间 ...

随机推荐

  1. height:100%

    子元素的高度设置为height:100%时 继承父元素的高度为border+height 子元素的高度为height: 此时父元素的 box-sizing:content-box: border-bo ...

  2. jquery chrome中取select 的值一就返回了

    在 <div class="controls"> <select class="span2" data-val="true" ...

  3. vivado/FPGA 使用小纪

    1.使用FPGA做为外部控制器的总线译码时,将总线时钟接在全局时钟脚上(MRCC),就算接在了局部时钟(SRCC)上,也要通过BUFG转为全局时钟走线,否则会因为local clk到各部分的时延较大引 ...

  4. python类型错误:'NoneType' object is not subscriptable

    TypeError: 'NoneType' object is not subscriptable --> 原因:变量使用了系统内置的关键字list 解决:重新定义下这个变量

  5. centos7.5图形界面与命令行界面转换

    查看当前状态下的显示模式: # systemctl get-default 转换为图形界面: # systemctl set-default graphical.target 转换为命令行界面: # ...

  6. Cocos Creator的类别

    cc是命名空间:cocos creater引擎下的类得加cc; 如cc.Node cc.v2; 1).cc.Component组件类onLoadstartupdatelateUpdateonDestr ...

  7. centos7中安装、配置jdk(转载)

    参考命令:http://www.jb51.net/os/RedHat/73016.html来进行安装 安装说明 系统环境:centos7安装方式:rpm安装软件:jdk-8u25-linux-x64. ...

  8. 关于easy ui 的combobox遍历选中

    $.post("fleetAction!queryAllCompanyByCompanyID.do",{"truckCompany.id":companyId} ...

  9. java输入输出流(I/O)总结

    io流的 四个基本类 java.io包中包含了流式I/O所需要的所有类.在java.io包中有四个基本类:InputStream.OutputStream及Reader.Writer类,它们分别处理字 ...

  10. 用 python 生成一个简单的词云图

    import jieba from nltk import * from wordcloud import WordCloud import matplotlib.pyplot as plt word ...