1.链接地址:

http://poj.org/problem?id=1936

http://bailian.openjudge.cn/practice/1936

2.题目:

All in All
Time Limit: 1000MS   Memory Limit: 30000K
Total Submissions: 26651   Accepted: 10862

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

Source

3.思路:

4.代码:

 #include "stdio.h"
//#include "stdlib.h"
#include "string.h"
#define NUM 100002
char s[NUM],t[NUM];
int main()
{
int i,j;
int len_s,len_t;
while(scanf("%s%s",s,t) != EOF)
{
len_s=strlen(s);
len_t=strlen(t);
i=;j=;
while(i<len_s && j<len_t)
{
if(s[i]==t[j]) i++;
j++;
}
//printf("%s%s\n",s,t);
if(i>=len_s) printf("Yes\n");
else printf("No\n");
}
//system("pause");
return ;
}

OpenJudge/Poj 1936 All in All的更多相关文章

  1. OpenJudge / Poj 2141 Message Decowding

    1.链接地址: http://poj.org/problem?id=2141 http://bailian.openjudge.cn/practice/2141/ 2.题目: Message Deco ...

  2. OpenJudge/Poj 2105 IP Address

    1.链接地址: http://poj.org/problem?id=2105 http://bailian.openjudge.cn/practice/2105 2.题目: IP Address Ti ...

  3. OpenJudge/Poj 2027 No Brainer

    1.链接地址: http://bailian.openjudge.cn/practice/2027 http://poj.org/problem?id=2027 2.题目: 总Time Limit: ...

  4. OpenJudge/Poj 2013 Symmetric Order

    1.链接地址: http://bailian.openjudge.cn/practice/2013 http://poj.org/problem?id=2013 2.题目: Symmetric Ord ...

  5. OpenJudge/Poj 1088 滑雪

    1.链接地址: bailian.openjudge.cn/practice/1088 http://poj.org/problem?id=1088 2.题目: 总Time Limit: 1000ms ...

  6. OpenJudge/Poj 2001 Shortest Prefixes

    1.链接地址: http://bailian.openjudge.cn/practice/2001 http://poj.org/problem?id=2001 2.题目: Shortest Pref ...

  7. OpenJudge/Poj 2000 Gold Coins

    1.链接地址: http://bailian.openjudge.cn/practice/2000 http://poj.org/problem?id=2000 2.题目: 总Time Limit: ...

  8. OpenJudge/Poj 1661 帮助 Jimmy

    1.链接地址: bailian.openjudge.cn/practice/1661 http://poj.org/problem?id=1661 2.题目: 总Time Limit: 1000ms ...

  9. OpenJudge/Poj 1915 Knight Moves

    1.链接地址: http://bailian.openjudge.cn/practice/1915 http://poj.org/problem?id=1915 2.题目: 总Time Limit: ...

随机推荐

  1. Jsp中的pageContext对象

    这个对象代表页面上下文.组要用于访问页面共享数据.使用pageContext可以直接访问request,session,application范围的属性,看看这些jsp的页面: JSP 页面使用 pa ...

  2. Xcode8 创建NSManageObject subclass方法

    更新iOS8之后发现coredata也做了一些改变,创建本地的时候一脸懵逼,最后发现: 喜极而泣不能自已,(-.-!)

  3. Why Does Everyone Else Appear to Be Succeeding?

    Why Does Everyone Else Appear to Be Succeeding?  —Steven G. Krantz When you are a student, it will a ...

  4. cocos2d-x 添加纹理自动回收机制

    转自:http://www.cnblogs.com/lancidie/archive/2013/04/13/3019375.html 1.不是一个完整的模块,所以不提供完整代码,只提供思路和核心代码. ...

  5. android131 360 02 设置中心

    // 判断是否需要自动更新 boolean autoUpdate = mPref.getBoolean("auto_update", true); if (autoUpdate) ...

  6. string与数值之间的转换

    9.50 编写程序处理一个vector<string>,其元素都表示整数型.计算vector中所有元素之和.修改程序,使之计算表示浮点值的string之和. 程序如下: #include& ...

  7. JAVA获取CLASSPATH路径--转

    ClassLoader提供了两个方法用于从装载的类路径中取得资源: public URL getResource(String name);         public InputStream ge ...

  8. javaScript面向对象基础

    最近学习了js的面向对象,为了能让自己更好的理解,这一篇博客就当作是加深自己学习印象的总结(可能会有很多不足,欢迎指正). js通过函数来创建对象,而且js本身也是一种对象,那么什么又是对象呢,对象包 ...

  9. LNMP一键安装包-CentOS 5/6下自动编译安装Nginx,MySQL,PHP

    适用环境: 系统支持:CentOS-5 (32bit/64bit).CentOS-6 (32bit/64bit) 内存要求:≥128M 安装了什么: 1.Nginx-1.2.0 2.MySQL 5.5 ...

  10. nodejs设置NODE_ENV环境变量

    看下app.js文件中的一部分代码,如下: //开发环境错误处理 // will print stacktrace if (app.get('env') === 'development') { ap ...