Compound Words UVA
来源:互联网 发布:什么软件测试兼容性 编辑:程序博客网 时间:2024/06/06 08:44
问题类型:STL-Map。
03pie’s solution for [UVA-10391]
题目链接
#include<iostream>#include<cstring>#include<map>using namespace std;map<string,int> words;int main(){ //freopen("F://inp.txt","r",stdin); string word; while(cin>>word){ words[word]=word.size(); } for(map<string,int>::iterator it=words.begin();it!=words.end();++it){ int len=it->second; string a=it->first,left,right; if(len>1){ for(int i=1;i<len;i++){ string left=a.substr(0,i); string right=a.substr(i,len-i); if(words[left]&&words[right]){ cout<<a<<"\n"; break; } } } } return 0;}
0 0
- uva 10391 compound words
- UVa 10391 - Compound Words
- uva 10391 - Compound Words
- uva 10391 - Compound Words
- UVa 10391 - Compound Words
- UVa 10391 - Compound Words
- uva 10391 - Compound Words
- UVA 10391 Compound Words
- UVA 10391 - Compound Words
- Uva-10391-Compound Words
- UVa 10391 - Compound Words
- uva--10391 - Compound Words
- UVA 10391 Compound Words
- UVa:10391 Compound Words
- uva 10391 Compound Words
- UVa 10391 - Compound Words
- UVA 10391 Compound Words
- UVA 10391 - Compound Words
- Java经典算法
- 虚拟IP原理
- galang 学习之grpc+ protobuf(二)
- 基本TCP套接字编程
- 仿微信朋友圈日期显示 时间戳格式化
- Compound Words UVA
- (转)Android事件总线(一)EventBus3.0用法全解析
- spring线程池配置及使用
- linux中不同系统之间的文件传输 文件归档,压缩
- Android动画插值器之PathInterpolator浅析
- svn 查看项目的 svn 服务器地址
- 图像镶嵌
- 显式加载动态库(多平台)
- Android微信支付及WXPayEntryActivity跳转失败