HDU 2203 亲和串 (想法题,字符串处理)
来源:互联网 发布:接了网络视频电话 编辑:程序博客网 时间:2024/05/16 12:20
给定两个字符串s1和s2,如果能通过s1循环移位,使s2包含在s1中,那么我们就说s2 是s1的亲和串。S1+S1后进行查找即可
#include<iostream>#include<sstream>#include<vector>#include<string>#include<algorithm>using namespace std;int main(){ string s1,s2; while(cin>>s1) { cin>>s2; s1=s1+s1; int ans=s1.find(s2); if(ans!=-1) cout<<"yes"<<endl; else cout<<"no"<<endl; } return 0;}
0 0
- HDU 2203 亲和串 (想法题,字符串处理)
- HDU 2203 亲和串
- HDU 2203 亲和串
- HDU - 2203 亲和串
- hdu 2203 亲和串
- hdu 2203 亲和串
- HDU 2203 亲和串
- HDU-亲和串-2203
- hdu 2203 亲和串
- hdu 2203 亲和串
- hdu 2203 亲和串
- hdu 2203 亲和串
- HDU 2203 亲和串
- HDU 2203【亲和串】
- hdu 2203 亲和串
- HDU 2203 亲和串
- hdu 2203亲和串
- HDU 2203 亲和串
- 的分是公司的分和的分人员规划的分个人用户公司的发生的规划的司法是的风格是的过
- 年西部季后赛首
- phpcms v9 如何用PC标签在列表页中同时调出文章内容
- 用SSH登陆远程服务器进行操作
- 的发送到发烧发生法
- HDU 2203 亲和串 (想法题,字符串处理)
- 瓦尔双方都三
- 鬼地方个梵蒂冈覆盖
- webview和html交互
- 测试 onSaveInstanceState(Bundle)方法
- 百度和谷歌还是有差距
- 候选人投票统计
- 家分规划的风格的是胎儿和的发生改革和是的分银行收费散热格栅的发生分羹
- ESPN的布莱恩-温德霍斯特