10391
来源:互联网 发布:ov7620数据手册 编辑:程序博客网 时间:2024/05/17 23:17
终于用map做了一道题
感觉如果可以重载 减号的话,用s2 - s1,在查找也挺好的。但我不会重载。。。
#include<cstdio>#include<iostream>#include<map>#include<string>using namespace std;const int maxn = 120000 + 5;map<string ,int > words;int main(){ string str[maxn]; int n = 0; while(cin >> str[n]){ words[str[n]] = 1; ++n;} for(int i = 0; i < n; ++i) { string str1,str2; str1.clear(); str2.clear(); for(int j = 0;j < str[i].length(); ++j) { str1 += str[i][j]; if(words[str1]==1) { str2 = &str[i][j+1]; if(words[str2]==1){cout << str[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
- drawRect和layoutSubviews的区别
- 常见排序算法总结
- c 全局静态变量的实例解释其作用域
- error: declaration may not appear after executable statement in block
- 2015,做更好的自己
- 10391
- fiddle
- 【Garry逆袭数据结构】之 链表 知识点学习--Android地基系列(一)
- C++使用libcurl做HttpClient
- 架构设计分享之权限系统(看图说话)
- Cocos2d-x android使用onKeyDown监听返回键实现二次返回退出
- 10763
- ceph存储 磁盘IOPS常识
- VPS上安装nginx来架设代理 更新中