POJ 1936
#include<iostream>
#include<string>
using namespace std; int main()
{
//freopen("acm.acm","r",stdin);
string s1;
string s2;
int len_1;
int len_2;
int i;
int j;
int index;
while(cin>>s1>>s2)
{
// cout<<s1<<endl;
// cout<<s2<<endl;
len_1 = s1.length();
len_2 = s2.length();
index = ;
for(i = ; i < len_1; ++ i)
{
for(j = index; j < len_2; ++ j)
{
if(s1[i] == s2[j])
{
index = j+;
break;
}
}
if(j == len_2)
{
break;
}
}
if(i == len_1)
{
cout<<"Yes"<<endl;
}
else
{
cout<<"No"<<endl;
}
}
}
关注我的公众号,当然,如果你对Java, Scala, Python等技术经验,以及编程日记,感兴趣的话。

技术网站地址: vmfor.com
POJ 1936的更多相关文章
- OpenJudge/Poj 1936 All in All
1.链接地址: http://poj.org/problem?id=1936 http://bailian.openjudge.cn/practice/1936 2.题目: All in All Ti ...
- POJ 1936 All in All(模拟)
All in All 题目链接:http://poj.org/problem?id=1936 题目大意:判断从字符串s2中能否找到子串s1.字符串长度为10W. Sample Input sequen ...
- poj 1936 All in All(水题)
题目链接:http://poj.org/problem?id=1936 思路分析:字符串子序列查找问题,设置两个指针,一个指向子序列,另一个指向待查找的序列,查找个字符串一次即可判断.算法时间复杂度O ...
- POJ 1936 All in All 匹配, 水题 难度:0
题目 http://poj.org/problem?id=1936 题意 多组数据,每组数据有两个字符串A,B,求A是否是B的子串.(注意是子串,也就是不必在B中连续) 思路 设置计数器cnt为当前已 ...
- Poj 1936,3302 Subsequence(LCS)
一.Description(3302) Given a string s of length n, a subsequence of it, is defined as another string ...
- poj 1936 All in All
All in All Time Limit: 1000 MS Memory Limit: 30000 KB 64-bit integer IO format: %I64d , %I64u Java ...
- 简单的字符串比较题 POJ 1936
Description You have devised a new encryption technique which encodes a message by inserting between ...
- All in All - poj 1936 (子串)
字符串子序列查找问题,设置两个指针,一个指向子序列,另一个指向待查找的序列,查找个字符串一次即可判断. #include <iostream> #include <string. ...
- POJ 1936 All in All(串)
All in All Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 27537 Accepted: 11274 Descript ...
随机推荐
- ASP.NET实现弹出框真分页将复选框选择的数据存到数据库中(四)
这是第四步点击保存将信息存入数据库中. 这个就简单了利用ajax将JSON字符串传到后台然后这里有个知识点就是将DataTable直接存入数据库中.代码如下: 一.界面获取数据JS代码: //保存订单 ...
- .NET开源工作流RoadFlow-系统布署及注意事项
非常感谢您在百忙之中抽空来了解RoadFlow,下面我们说一下如果在自己本地搭建环境吧. 1.环境要求 数据库:sqlserver2005以上版本.服务器:IIS6.0以上,或iisexpress.d ...
- C#之玩转反射【转:http://www.cnblogs.com/yaozhenfa/p/CSharp_Reflection_1.html】
前言 之所以要写这篇关于C#反射的随笔,起因有两个: 第一个是自己开发的网站需要用到 其次就是没看到这方面比较好的文章. 所以下定决心自己写一篇,废话不多说开始进入正题. 前期准备 在VS20 ...
- Web开发者和设计师必须要知道的 iOS 8 十个变化
原文出处: mobilexweb 译文出处:罗磊(@罗罗磊磊) 欢迎分享原创到伯乐头条 喜大普奔,喜极而泣,喜当爹,随着iPhone 6和iPhone 6 plus的上市,ios 8终于在上周 ...
- Client–server model
Client–server model From Wikipedia, the free encyclopedia The client–server model of computing ] Oft ...
- MS Chart-按照数据库的最大最小时间设置X轴label.
核心代码: Chart1.ChartAreas[0].AxisX.Interval = (Front_Max - Front_Min).Days / 2; Chart1.ChartAreas[0].A ...
- html a 链接
1.链接元素 文本.图像.热区 2.标记 描述性文字 target窗口形式 _self:在自身窗口打开(默认) _blank:在新窗口打开 _parent:在父窗口打开 _top:在顶窗口打开 框架或 ...
- UISegmentedControl swift
// // ViewController.swift // UILabelTest // // Created by mac on 15/6/23. // Copyright (c) 2015年 fa ...
- P1951: [Sdoi2010]古代猪文
呜啊啊啊啊,选错了题,原以为很简单的优化+剪枝就能过结果牵扯到了一堆数论知识.我的错,贴上我的代码(已经尽量优化了) ; var n,g,i,j,ans:longint; tem:int64; fun ...
- Indigo Studio
http://www.infragistics.com/products/indigo-studio?gclid=CIXrnav4lcQCFdclvQoduVEAnA