hdu 1113 Word Amalgamation
原题链接: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的更多相关文章
- hdu 1113 Word Amalgamation 解题报告
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1113 题意:输入一个字典,然后再输入若干单词(每行中,1 <= 单词数 <= 100,并且 ...
- hdu - 1113 Word Amalgamation (stl)
http://acm.hdu.edu.cn/showproblem.php?pid=1113 给定一个字典,然后每次输入一个字符串问字典中是否有单词与给定的字符串的所有字母一样(顺序可以打乱),按字典 ...
- HDU 1113 Word Amalgamation (map 容器 + string容器)
http://acm.hdu.edu.cn/showproblem.php?pid=1113 Problem Description In millions of newspapers across ...
- HDOJ/HDU 1113 Word Amalgamation(字典顺序~Map)
Problem Description In millions of newspapers across the United States there is a word game called J ...
- HDOJ.1113 Word Amalgamation(map)
Word Amalgamation 点我挑战题目 点我一起学习STL-MAP 题意分析 给出字典.之后给出一系列======乱序======单词,要求你查字典,如过这个乱序单词对用有多个有序单词可以输 ...
- hdu1113 Word Amalgamation(详解--map和string的运用)
版权声明:本文为博主原创文章.未经博主同意不得转载. vasttian https://blog.csdn.net/u012860063/article/details/35338617 转载请注明出 ...
- Word Amalgamation(枚举 + 排序)
Word Amalgamation Time Limit: 1 Sec Memory Limit: 64 MB Submit: 373 Solved: 247 Description In mil ...
- hdu-----(1113)Word Amalgamation(字符串排序)
Word Amalgamation Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others ...
- Word Amalgamation(hdoj1113)
Word Amalgamation Problem Description In millions of newspapers across the United States there is a ...
随机推荐
- tar: 从成员名中删除开头的“/”
在压缩文件时,当后面的备份目录使用绝对路径时,会出现: tar zcvf /usr/OutFile.tar.gz /data/CTest tar: 从成员名中删除开头的“/” 此时,对tar增加 ...
- 再看.net本质
1.[资源的地址-通用资源标识符] 我们在地址栏中输入的内容称为通用资源标识符(Universal Resource Identifier,URI),它有很多种形式,在Web中我们通常使用称为统一资源 ...
- JavaScript基本用法
首次创建 $(document).ready(function () { });
- 高效渲染css
译自:http://css-tricks.com/efficiently-rendering-css/ 无可否认我并不经常考虑这个问题… 我们书写的CSS的效率如何,浏览器渲染它的速度如何? 浏览器的 ...
- C++读取ini文件的类
取自:http://www.viksoe.dk/code/all_mfc.htm,里面有各种MFC常用的类 // Ini.h: interface for the CIni class. // // ...
- aspx网页相对布局
网页的布局 <body bgcolor="#b6b7bc"> <form id="form1" runat="server" ...
- 1.6Linux设备驱动
1.设备驱动的作用: 计算机系统的运行是软硬件共同作用的结果.如果应用程序直接访问硬件,会造成应用程序与硬件耦合度过高(了解面向对象的读者会很容易想到,降低对象与对象之间的耦合度最有效的方法是通过接口 ...
- nginx安装详解
一.环境: 1.Linux:centos6.4(32位) 2.Gcc的编译环境.使用make命令编辑. yum install gcc-c++ 3.PCRE PCRE(Perl Compatible ...
- Tomcat启动过程(一):从BootStrap到EndPonit
Tomcat版本tomcat6.0.44观察catalina.sh文件,启动入口:org.apache.catalina.startup.Bootstrap,该类main方法执行下面三个方法----- ...
- Mysql迁移工具在生产环境下的使用
在产品迭代开发发布过程中,由于业务需求的增加,数据库难免会有结构调整等操作. 在每个版本发布过程中怎么控制每个版本server端程序与数据库版本保持一致,以及数 据库升级.回滚等操作. 本博文宅鸟将向 ...