原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1113

字符串简单题:

stl水过

如下:

 #include<algorithm>
#include<iostream>
#include<cstdlib>
#include<cstring>
#include<cstdio>
#include<string>
#include<map>
#include<set>
using std::set;
using std::map;
using std::sort;
using std::string;
using std::next_permutation;
set<string> rec;
int _main(){
#ifdef LOCAL
freopen("in.txt", "r", stdin);
freopen("out.txt", "w+", stdout);
#endif
int c = ;
char buf[], tmp[];
while (~scanf("%s", buf) && c != ){
if (!c && strcmp(buf, "XXXXXX") != ) rec.insert(buf);
else if ( == strcmp(buf, "XXXXXX")) c++;
else {
int flag = , n = strlen(buf);
strcpy(tmp, buf);
sort(tmp, tmp + n);
do{
if (rec.count(tmp) != ) flag = , printf("%s\n", tmp);
} while (next_permutation(tmp, tmp + n));
if (!flag) printf("NOT A VALID WORD\n", tmp);
printf("******\n");
}
}
return ;
}

hdu 1113 Word Amalgamation的更多相关文章

  1. hdu 1113 Word Amalgamation 解题报告

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1113 题意:输入一个字典,然后再输入若干单词(每行中,1 <= 单词数 <= 100,并且 ...

  2. hdu - 1113 Word Amalgamation (stl)

    http://acm.hdu.edu.cn/showproblem.php?pid=1113 给定一个字典,然后每次输入一个字符串问字典中是否有单词与给定的字符串的所有字母一样(顺序可以打乱),按字典 ...

  3. HDU 1113 Word Amalgamation (map 容器 + string容器)

    http://acm.hdu.edu.cn/showproblem.php?pid=1113 Problem Description In millions of newspapers across ...

  4. HDOJ/HDU 1113 Word Amalgamation(字典顺序~Map)

    Problem Description In millions of newspapers across the United States there is a word game called J ...

  5. HDOJ.1113 Word Amalgamation(map)

    Word Amalgamation 点我挑战题目 点我一起学习STL-MAP 题意分析 给出字典.之后给出一系列======乱序======单词,要求你查字典,如过这个乱序单词对用有多个有序单词可以输 ...

  6. hdu1113 Word Amalgamation(详解--map和string的运用)

    版权声明:本文为博主原创文章.未经博主同意不得转载. vasttian https://blog.csdn.net/u012860063/article/details/35338617 转载请注明出 ...

  7. Word Amalgamation(枚举 + 排序)

    Word Amalgamation Time Limit: 1 Sec  Memory Limit: 64 MB Submit: 373  Solved: 247 Description In mil ...

  8. hdu-----(1113)Word Amalgamation(字符串排序)

    Word Amalgamation Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others ...

  9. Word Amalgamation(hdoj1113)

    Word Amalgamation Problem Description In millions of newspapers across the United States there is a ...

随机推荐

  1. centos6.5没有eth0, 只有eth1, eth1无法上网

    1. cat  /etc/udev/rules.d/70-persistent-net/rules 2.将ATTR(address)=XXXXXXXX的内容 替换  文件/etc/sysconfig/ ...

  2. MySQL:MySQL和SQL Server的区别

    导读:接下来的网上商城的项目,需要用到MySQL数据库了.这个对于我来说,是一个新接触的东西,按照惯例,在刚开始学习一个东西的时候,先从宏观上去了解它.本篇博客,先介绍SQL Server的基本内容, ...

  3. iOS之UIAlertView的使用

    UIAlertView: 1.普通使用: //普通的alert UIAlertView *av = [[UIAlertView alloc]initWithTitle:@"title&quo ...

  4. JS常用的设计模式(7)—— 外观模式

    外观模式(门面模式),是一种相对简单而又无处不在的模式.外观模式提供一个高层接口,这个接口使得客户端或子系统更加方便调用.用一段再简单不过的代码来表示 var getName = function() ...

  5. use python get information from one page

    #!/usr/bin/python read = file('thread-1554-1-1.html','r') wr = file('list','w') while 1: line=read.r ...

  6. 017Makefile工程管理

    1.为什么需要Makefile? 利用Makefile和make的合作,可以把很多很多的工作合并成一个非常简单的命令:make: make能够使整个程序的编译.链接只需要一个命令(make)就可以完成 ...

  7. SQL笔记-第一章,数据库入门

    DBMS的分类DB2.Oracle.Microsoft SQL Server.Sybase SQLServer.Informix.MySQL数据库的结构元素库 database表 table列 col ...

  8. 搭建高性能计算环境(十)、应用软件的安装之Wien2k

    1,首先安装fftw .tar.gz cd fftw- ./configure --prefix=/opt/fftw- --enable-shared --enable-float --enable- ...

  9. 举例详解CSS中的继承

    CSS的继承是由所使用的样式属性定义的.换句话说,当你查看CSS属性backgruound-color,你会看到一栏「继承性」,也许你几乎没有在意过它,但是它还是十分有用的.什么是CSS继承 每一个元 ...

  10. 使用CSS创建有图标的网站导航菜单

    在我创建的每一个互联网应用中,我都试图避免创建完全由图片组成的菜单.在我看来,网页菜单系统中应该使用文字.这样做也会让菜单变得更干净利落.清晰和易读,不用考虑应用程序如何读取它,以及页面放大的时候也不 ...