UVA 10391 Compound Words(hash字符串)
来源:互联网 发布:js中获取name属性 编辑:程序博客网 时间:2024/05/17 23:21
#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>#include<set>using namespace std;#define rep(i,a,b) for(int i=(a);i<=(b);i++)string s[120000+100];int main(){ ios::sync_with_stdio(0); set<string> hash; hash.clear(); int i=0; while(cin>>s[i]) { hash.insert(s[i]); i++; } rep(j,0,i-1) rep(k,1,s[j].size()-1){ if(s[j].size()==1) continue; if(hash.count(s[j].substr(0,k))&&hash.count(s[j].substr(k,s[j].size()))) {cout<<s[j]<<endl;break;}//找到break退出,否则重复输出 } return 0;}
0 0
- UVa 10391 - Compound Words 字符串hash
- UVA 10391 - Compound Words 字符串hash
- uva 10391 Compound Words (字符串-hash)
- UVa 10391 - Compound Words (字符串hash)
- UVA 10391 Compound Words(hash字符串)
- UVA - 10391 Compound Words(hash)
- UVa 10391 Compound Words(字符串+查找)
- UVa10391-- Compound Words(字符串hash)
- 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
- .net的安装与卸载
- LeetCode OJ-42-Trapping Rain Water
- Android 2016新技术
- 巧用cssText
- swift中UIActivityIndicatorView的使用
- UVA 10391 Compound Words(hash字符串)
- arm架构基础知识小结
- iframe标签用法详解(属性、透明、自适应高度)
- Moving Tables
- Android中TextView属性全纪录
- java程序代码实现手机号码归属地查询
- linux 安装jdk tomcat
- 题目1024:畅通工程
- requirejs的用法