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. 【BZOJ1833】【ZJOI2010】数字计数 数位DP

    链接: #include <stdio.h> int main() { puts("转载请注明出处[辗转山河弋流歌 by 空灰冰魂]谢谢"); puts("网 ...

  2. header的用法小结(转)

    php header()函数的具体作用是向客户端发送一个原始 HTTP 标头[Http Header]到客户端. 标头 (header) 是服务器以 HTTP 协义传 HTML 资料到浏览器前所送出的 ...

  3. RPM制作

    http://blog.csdn.net/justlinux2010/article/details/9905425

  4. 在Ubuntu 12.10 上安装部署Openstack

    OpenStack系统有几个关键的项目,它们能够独立地安装但是能够在你的云计算中共同工作.这些项目包括:OpenStack Compute,OpenStack Object Storage,OpenS ...

  5. Dreamweaver cs6安装破解

    Dreamweaver 是前端开发的必备软件.目前最新版本为CS6,与CS5相比多了对HTML5.CSS3.jquery的关联支持,可以更方便的在Dreamweaver中编写前端代码. 安装准备: 1 ...

  6. iOS 数据持久化(1):属性列表与对象归档

    @import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css); @import url(/ ...

  7. Java(Android)线程池 总结

        JAVA的Executors源码:(可以看出底层都是通过ThreadPoolExecutor来具体设置的~) public static ExecutorService newCachedTh ...

  8. python爬虫scrapy的Selectors参考文档

    http://doc.scrapy.org/en/1.0/topics/selectors.html#topics-selectors-htmlcode

  9. java判断字符串是否为空的方法总结

    http://blog.csdn.net/qq799499343/article/details/8492672 以下是java 判断字符串是否为空的四种方法: 方法一: 最多人使用的一个方法, 直观 ...

  10. Eclipse代码自动填充.

    在默认情况下,Eclipse只在程序员输入“.”并用ALT+/组合键强制调用编码提示功能 我们可以通过少量配置,让Eclipse更聪明,实现完全自动编码提示:1.在你的“工作空间”下找到下在文件.me ...