原题链接: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. 关于Rational Functional Tester (RFT)的简单介绍

    前段时间给客户做了个RFT的简单培训,以下.因为涉及到公司的框架,所以中间省去了很多框架里的细节,只留了一个框架的总体结构的概览. RFT IBM Rational Functional Tester ...

  2. Android之EventBus使用详解

    一.概述 当Android项目越来越庞大的时候,应用的各个部件之间的通信变得越来越复杂,例如:当某一条件发生时,应用中有几个部件对这个消息感兴趣,那么我们通常采用的就是观察者模式,使用观察者模式有一个 ...

  3. ubuntu server unable to resolve host

    cat /etc/resolv.conf (查看resolv.conf中的内容: nameserver 是动态添加的……) #通过添加/etc/resolvconf/resolv.conf.d/bas ...

  4. AX 条码打印

    AX 条码打印集成在BarCode类及其之类barcode*. 由子类的defaultFont方法指定字体属性. eg, BarcodeCode39 指定条码字体"BC C39 3 to 1 ...

  5. Windows Phone开发(12):认识一下独具个性的磁贴(转)

    对"磁贴"的理解是一点也不抽象的,为什么呢?只要你愿意启动WP系统,无论你是在模拟器中还是在真机中,是的,桌面上那一块块像地板的玩意儿,就是磁贴了.(图:磁贴) 在上图中,我们很直 ...

  6. 深入浅出 RPC - 浅出篇+深入篇

    摘自: http://blog.csdn.net/mindfloating/article/details/39473807 近几年的项目中,服务化和微服务化渐渐成为中大型分布式系统架构的主流方式,而 ...

  7. Android knock code analysis

    My colleague she forgot the knock code and ask me for help. I know her phone is LG G3 D855 with Andr ...

  8. input文本框实现宽度自适应代码实例,input文本框

    本章节介绍一下如何让一个文本框的宽度能够随着文本框中的内容的宽度增长而增长,也就是能够实现宽度自适应效果. 代码实例如下: <!DOCTYPE html> <html> < ...

  9. event.preventDefault()

    <!doctype html> <html lang="en"> <head> <meta charset="utf-8&quo ...

  10. VC++ 在类中添加多线程操作

    CTestThread.h public: CTestThread(void); ~CTestThread(void); public: void setvalue(); static DWORD _ ...