10391
来源:互联网 发布:巨潮资讯 数据库接口 编辑:程序博客网 时间:2024/05/22 16:44
紫书上习题5-5;map 容器做,做了好长时间,又是输出的事,我的内心是拒绝的,因为输出的事,我已经有好几道题 wrong answer 了,以后要改啊;
#include <iostream>#include <cstdio>#include <cstdlib>#include <string>#include <map>#define INF 1E9using namespace std;map<string,bool> has;string s[150000];int main(){ int i,j; int cnt=0; has.clear(); while(cin>>s[cnt]) { has[s[cnt]]=1; cnt++; } string a,b; for(i=0;i<cnt;i++) for(j=0;j<s[i].size()-1;j++) { a=s[i].substr(0,j+1); if(!has[a])continue; b=s[i].substr(j+1); if(!has[b])continue; cout<<s[i]<<endl; break; } return 0;}
0 0
- 10391
- 10391
- 10391
- uva 10391
- UVA 10391
- uva 10391
- uva 10391
- UVA 10391
- Uva 10391
- uva 10391 compound words
- UVa 10391 - Compound Words
- uva 10391 - Compound Words
- uva 10391 - Compound Words
- UVa 10391 - Compound Words
- UVa 10391 - Compound Words
- Compound Words 10391
- uva 10391 - Compound Words
- 10391 - Compound Words
- poj2533
- 操作系统常见面试题
- day38_springAOP2
- First Blog
- Spring AOP(动态代理\动态字节码)精华一页纸
- 10391
- 自适应布局-float
- 开通博客的第一天。
- @ComponentScan 和 @Configuration
- php生成的验证码图片不显示问题
- 题目1060:完数VS盈数
- Frence Repair POJ3253 POJ2431 堆排序
- awk 学习记录1
- Android作为服务器通过USB使用Socket协议向PC客户端发送文件