https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1332

#include<iostream>
#include<stdio.h>
#include<string.h>
#include<string>
#include<map>
using namespace std;
string ss;
char s[][];
int main()
{
int i,j;
i=;
map<string,int>Map;
while()
{
gets(s[i]);
if(strcmp(s[i],"")==)
break;
int len=strlen(s[i]);
ss="";
for(j=;j<len;j++)
{
ss+=s[i][j];
}
Map[ss]=;
i++;
}
int l=i;
string s1,s2;
for(i=;i<l;i++)
{
s1="";
int fl=strlen(s[i]);
for(j=;j<fl;j++)
{
s1+=s[i][j];
s2="";
for(int k=j+;k<fl;k++)
{
s2+=s[i][k];
}
if(Map[s1]==&&Map[s2]==)
{
printf("%s\n",s[i]);
break;
}
}
}
}

UVA 10391 stl的更多相关文章

  1. UVa 10391 (水题 STL) Compound Words

    今天下午略感无聊啊,切点水题打发打发时间,=_=|| 把所有字符串插入到一个set中去,然后对于每个字符串S,枚举所有可能的拆分组合S = A + B,看看A和B是否都在set中,是的话说明S就是一个 ...

  2. 复合词(Compound Words, UVa 10391)(stl set)

    You are to find all the two-word compound words in a dictionary. A two-word compound word is a word i ...

  3. UVA 11997 STL 优先队列

    题目链接: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem ...

  4. UVA 11995 STL 使用

    There is a bag-like data structure, supporting two operations: 1 x Throw an element x into the bag. ...

  5. UVA 10391 - Compound Words 字符串hash

    http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&p ...

  6. UVA 540 stl

    Queues and Priority Queues are data structures which are known to most computer scientists. The Team ...

  7. UVa 10763 (STL) Foreign Exchange

    看到大神说location的值不会超过1000,所以这就简单很多了,用一个deg数组记录下来每个点的度,出度-1,入读+1这样. 最后判断每个点的度是否为0即可. 至于为什么会这样,据说是套数据套出来 ...

  8. UVa 12096 (STL) The SetStack Computer

    题意: 有一个集合栈计算机,栈中的元素全部是集合,还有一些相关的操作.输出每次操作后栈顶集合元素的个数. 分析: 这个题感觉有点抽象,集合还能套集合,倒是和题中配的套娃那个图很贴切. 把集合映射成ID ...

  9. UVa 221 (STL 离散化) Urban Elevations

    题意: 作图为n个建筑物的俯视图,右图为从南向北看的正视图,按从左往右的顺序输出可见建筑物的标号. 分析: 题中已经说了,要么x相同,要么x相差足够大,不会出现精度问题. 给这n个建筑物从左往右排序, ...

随机推荐

  1. tarjan算法+缩点:求强连通分量 POJ 2186

    强连通分量:1309. [HAOI2006]受欢迎的牛 ★★   输入文件:cow.in   输出文件:cow.out   简单对比时间限制:1 s   内存限制:128 MB [题目描述] 每一头牛 ...

  2. maven总结1

     环境:win7   maven版本:apache-maven-3.1.1-bin.zip maven安装 1.确定已经正确安装jdk,若未安装需要先安装jdk 2.http://maven.apac ...

  3. ZIP文件伪加密

    题目给出图片,那当然是从图片下手啦! 首先下载图片,在Linux系统下用binwalk工具打开,果然不出所料,里面藏有文件! 用dd把它分解出来! 'txt' 格式的文件提取出来!会看到一个Zip压缩 ...

  4. sqlzoo.net刷题2

    Find the largest country (by area) in each continent, show the continent, thename and the area: 找到每个 ...

  5. ruby on rails gem install pg时无法安装

    gem install pg -v '0.18.2' Building native extensions. This could take a while... ERROR: Error insta ...

  6. Linux非root用户安装jdk和tomcat

    转载自:http://blog.csdn.net/wuyigong111/article/details/17410661,进行部分修改 创建一个用户 sgmm,并在其用户目录里面安装 jdk和tom ...

  7. php基础28:文件读取

    <?php //1.追加文件内容 // $fp = fopen("test.txt", "a"); // $outString = "this ...

  8. ffmpeg常用基本命令(转)

    [FFmpeg]FFmpeg常用基本命令 1.分离视频音频流 ffmpeg -i input_file -vcodec copy -an output_file_video //分离视频流 ffmpe ...

  9. .NET面试题解析(07)-多线程编程与线程同步 (转)

    http://www.cnblogs.com/anding/p/5301754.html 系列文章目录地址: .NET面试题解析(00)-开篇来谈谈面试 & 系列文章索引 关于线程的知识点其实 ...

  10. Asp.net与Dojo交互:仪器仪表实现

    项目中需要用到仪器仪表的界面来显示实时的采集信息值,于是便遍地寻找,参考了fusionchart和anychart之后,发现都是收费的,破解的又没有这些功能,只好作罢.之后又找遍了JQuery的插件, ...