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. mybatis-generator-core自动生成do、mapping、dao 代码

    使用mybatis配置映射文件,有点麻烦,容易出错,可以使用jar工具自动生成代码,即高效又方便 一.下载两个jar,并放置在G:\tool\maven\generator目录下(自己定义) myba ...

  2. hadoop的hdfs文件操作实现上传文件到hdfs

    这篇文章主要介绍了使用hadoop的API对HDFS上的文件访问,其中包括上传文件到HDFS上.从HDFS上下载文件和删除HDFS上的文件,需要的朋友可以参考下hdfs文件操作操作示例,包括上传文件到 ...

  3. Winfrom treeview 如何从多个数据表中获取数据动态生成

    本文转载:http://www.cnblogs.com/VincentLuo/archive/2008/03/29/1128987.html 在 汪洋怡舟的这篇文章中[http://www.cnblo ...

  4. C#基础知识之方法重载总结

    1.首先解释一下什么是方法重载?    方法重载是指在同一个类中方法同名,参数不同,调用时根据实参的形式,选择与他匹配的方法执行操作的一种技术. 这里所说的参数不同是指以下几种情况: ①  参数的类型 ...

  5. mysql slow log分析工具的比较

    mysql 中的 slow log 是用来记录执行时间较长(超过 long_query_time 秒)的 sql 的一种日志工具. 启用 slow log 在 my.cnf 中设置 [mysqld] ...

  6. 将Excel数据导入MySql

    1.将选中的数据快儿拷贝到一个TXT文本文件中(记得把后面的空格消掉..),假如存到“D:\data.txt”这个位置里. 2.根据要导入的数据快儿建立MySql数据库和表,然后进入命令提示符里使用命 ...

  7. iOS 改变tableview cell的背景色

    cell.selectedBackgroundView = [[UIView alloc] initWithFrame:cell.frame]; cell.selectedBackgroundView ...

  8. ef6 dbfirst 实现同一套代码多个数据库访问

    codefirst可以通过DbConfiguration实现,但是dbfitst无法做到,弄了一天,搞定了,下面是步骤 1.将.edmx的 元数据处理项目改成 复制输出到目录 2.bs项目添加App_ ...

  9. 用csc命令行手动编译cs文件

    一般初学c#时,用记事本写代码,然后用命令行执行csc命令行可以编译cs文件.方法有两种 1:配置环境,一劳永逸 一般来说在C:\Windows\Microsoft.NET\Framework\v4. ...

  10. SAP ABAP MARD和MARDH计算逻辑

    mard里记载的是当前库存的数量,但是期间并不一定是当月.比如你物料4月一整月都没有库存数量变化(没收没发),那么5月初你看mard里的条目期间数还是4月而非5月. 当某个期间发生货物移动的时候,系统 ...