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. UVA 12723 Dudu, the Possum --数学期望

    题意不说了,概率和期望值要分开处理. 方法1:可以先算出到达每层的概率,然后再乘以每层的期望,每层的期望是固定的. 方法二:也可以从后往前直接推期望.为什么从后往前呢?因为第i层的时候,它可以跳到的层 ...

  2. 2014 Super Training #2 F The Bridges of Kolsberg --DP

    原题:UVA 1172  http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_ ...

  3. [推荐]看图/图片管理软件XnViewMP

    软件授权:免费 (希望你可以支持开发者) 软件官网:http://www.xnview.com/en/xnviewmp/ 软件简介: XnView MP 是一款非常著名的免费看图软件XnView 的新 ...

  4. C# Process执行bat

    Process类 System.Diagnostics 命名空间提供类,使您能够与系统进程.事件日志和性能计数器进行交互. Process类提供对本地和远程进程的访问并使您能够启动和停止本地系统进程. ...

  5. 服务器操作系统应该选择 Debian/Ubuntu 还是 CentOS?

    来自 http://www.zhihu.com/question/19599986 服务器操作系统应该选择 Debian/Ubuntu 还是 CentOS? 想选择一个 Linux 发行版作为服务器. ...

  6. android studio 使用入门 (快捷键等收集)

    1. 解决 android studio cannot resolve symbol 1) file->import proj->create proj from exit proj .. ...

  7. Spring addFlashAttribute

    redirectAttributes.addFlashAttribute("result",accountModel); 用这个可以绑定session 但是只能用一次,可以避免最后 ...

  8. PHP 运行方式(PHP SAPI介绍)

    SAPI:Server Application Programming Interface 服务器端应用编程端口.它就是PHP与其它应用交互的接口,PHP脚本要执行有很多种方式,通过Web服务器,或者 ...

  9. 1976 Queen数列

    1976 Queen数列  时间限制: 1 s  空间限制: 128000 KB  题目等级 : 黄金 Gold 题解  查看运行结果     题目描述 Description 将1到N的整数数列(1 ...

  10. pandas groupby

    pandas.DataFrame.groupby DataFrame.groupby(by=None, axis=0, level=None, as_index=True, sort=True, gr ...