Crawling in process... Crawling failed

Description

You have devised a new encryption technique which encodes a message by inserting between its characters randomly generated strings in a clever way. Because of pending patent issues we will not discuss in detail how the strings are generated and inserted into the original message. To validate your method, however, it is necessary to write a program that checks if the message is really encoded in the final string.

Given two strings s and t, you have to decide whether s is a subsequence of t, i.e. if you can remove characters from t such that the concatenation of the remaining characters is s.

Input

The input contains several testcases. Each is specified by two strings s, t of alphanumeric ASCII characters separated by whitespace.The length of s and t will no more than 100000.

Output

For each test case output "Yes", if s is a subsequence of t,otherwise output "No".

Sample Input

sequence subsequence
person compression
VERDI vivaVittorioEmanueleReDiItalia
caseDoesMatter CaseDoesMatter

Sample Output

Yes
No
Yes
No

题意很是明确,不用说;

上代码
 #include<stdio.h>
#include<string.h>
char s[],p[];
int main()
{
int i,j,lens,lenp;
while(~scanf("%s %s",s,p))
{
lens=strlen(s);
lenp=strlen(p);
i=;
j=;
while(j<lens&&i<lenp)
{
if(s[j]==p[i])
j++;
i++;
}
if(j==lens)
printf("Yes\n");
else
printf("No\n");
}
return ;
}

随机推荐

  1. 9.28noip模拟试题

    1.栅栏迷宫 田野上搭建了一个黄金大神专用的栅栏围成的迷宫.幸运的是,在迷宫的边界上留出了两段栅栏作为迷宫的出口.更幸运的是,所建造的迷宫是一个“完美的”迷宫:即你能从迷宫中的任意一点找到一条走出迷宫 ...

  2. asp.net下载文件的几种方法

    最近做东西遇到了下载相关的问题.在这里总结一下自己处理的方法. 1.以字节流的形式向页面输出数据以下载Excel为例子. string path=Server.MapPath("文件路径&q ...

  3. 数据的动态合并和导出至EXCEL

    最近一段时间都在处理数据的动态合并和导出EXCEL的问题,写个demo记录下,希望和我碰到同样问题的博友可以顺利解决:后面会提供demo下载链接. (VS2012,ASP.NET) 一.主要解决以下问 ...

  4. sqlserver时间字符串的截取

    昨天同学问了个sqlserver的问题,写了个简单的示例,如下: 问题:“15:00-16:30”拆分成“15:00-15:30”.“15:30-16:00”.“16:00-16:30”? 代码: d ...

  5. Oracle分区表学习

    (1) 表空间及分区表的概念表空间: 是一个或多个数据文件的集合,所有的数据对象都存放在指定的表空间中,但主要存放的是表, 所以称作表空间.分区表: 当表中的数据量不断增大,查询数据的速度就会变慢,应 ...

  6. power desinger 学习笔记<四>

    Tools <display preferences> <content table> <advanced> Columns 选择放大镜图标 进入窗口 选择要顺序显 ...

  7. OpenSSL安装及目录介绍

    1. 下载安装OpenSSL 2. 根据需要下载安装Visual C++ Redistributable 3. 安装完成OpenSSL后,目录结构如下所示 其中,bin文件夹下是OpenSSL主程序的 ...

  8. IOS学习--UIButton常用方法(20150122)

    // 1.创建一个自定义的按钮 UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; // 2.添加按钮 [self.view a ...

  9. IOS常用开源库

    转自:http://www.csdn.net/article/2013-06-18/2815806-GitHub-iOS-open-source-projects-two/1 1. AFNetwork ...

  10. mahout的安装、配置及运行java程序

    一.下载安装包: http://mahout.apache.org/general/downloads.html 二.解压: 将下载的安装包解压到需要的目录下 三.配置环境变量: export MAH ...