OpenJudge/Poj 1936 All in All
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 CaseDoesMatterSample Output
Yes
No
Yes
NoSource
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的更多相关文章
- OpenJudge / Poj 2141 Message Decowding
1.链接地址: http://poj.org/problem?id=2141 http://bailian.openjudge.cn/practice/2141/ 2.题目: Message Deco ...
- OpenJudge/Poj 2105 IP Address
1.链接地址: http://poj.org/problem?id=2105 http://bailian.openjudge.cn/practice/2105 2.题目: IP Address Ti ...
- OpenJudge/Poj 2027 No Brainer
1.链接地址: http://bailian.openjudge.cn/practice/2027 http://poj.org/problem?id=2027 2.题目: 总Time Limit: ...
- OpenJudge/Poj 2013 Symmetric Order
1.链接地址: http://bailian.openjudge.cn/practice/2013 http://poj.org/problem?id=2013 2.题目: Symmetric Ord ...
- OpenJudge/Poj 1088 滑雪
1.链接地址: bailian.openjudge.cn/practice/1088 http://poj.org/problem?id=1088 2.题目: 总Time Limit: 1000ms ...
- OpenJudge/Poj 2001 Shortest Prefixes
1.链接地址: http://bailian.openjudge.cn/practice/2001 http://poj.org/problem?id=2001 2.题目: Shortest Pref ...
- OpenJudge/Poj 2000 Gold Coins
1.链接地址: http://bailian.openjudge.cn/practice/2000 http://poj.org/problem?id=2000 2.题目: 总Time Limit: ...
- OpenJudge/Poj 1661 帮助 Jimmy
1.链接地址: bailian.openjudge.cn/practice/1661 http://poj.org/problem?id=1661 2.题目: 总Time Limit: 1000ms ...
- OpenJudge/Poj 1915 Knight Moves
1.链接地址: http://bailian.openjudge.cn/practice/1915 http://poj.org/problem?id=1915 2.题目: 总Time Limit: ...
随机推荐
- ecshop后台admin文件夹任意更改名
为了ecshop网站安全起见或不想泄露后台的路径,那么我们必须修改后台admin文件夹名称. 方法和步骤如下: 把原admin文件夹名改成edait为例来说明 首先,把商城根目录下的admin文件夹重 ...
- 我的第一篇博客 ——【ToDoList】小程序开发
我是一只即将大四的大三狗,这是我的第一篇博客,说来惭愧.今年1月份,学校放寒假的时候开始自学的IOS,放假的时候比较起劲,看了一堆Object-C的视频,然后照着中英文对照的IOS基础开发教程,做了两 ...
- 漂亮的自制java验证码
网上有很多开源的验证码插件,例如jcaptcha,kaptcha等等...这些都不错,不过感觉用起来不太舒服,最后还是网上找了个原型的,然后在这个基础上修改下,效果还算不错,凑合用下,验证码要做到难以 ...
- 【22】将成员变量声明为private
1.为什么要将成员变量声明为private,语法一致性,只通过方法暴露接口. 2.使用方法,可以对成员变量更精确的控制.比如:为所有可能的实现提供弹性,不同实现可以替换:控制可读可写:验证约束条件:处 ...
- web项目设计中框架的数据流
这张图虽然简单,但是很好的说明了一个web框架,需要实现那些模块. 图片来自 <Go Web编程>
- c# label的内容显示不全
c# label的内容显示不全.须要设置例如以下属性就可以: 1.将Lable的font属性的字体改成宋体: 2.将AutoSize属性改成true: 然后内容就能够显示所有了.
- windows下ftp上传下载和一些常用命令
先假设一个ftp地址 用户名 密码 FTP Server: home4u.at.china.com User: yepanghuang Password: abc123 打开windows的开始菜单, ...
- MySQL(4):数据表创建
数据库是表的容器,表,必须属于某个数据库. 可以通过.语法,指明数据表所属的数据库 比如:database.table 进行表操作的时候,都会指定当前的默认数据库. use db_name; 1.创建 ...
- 0x800a1391-Microsoft Jscript "JSON未定义"
本人在进行调试代码是遇到以下问题: 在运行到var result = JSON.parse(data);这句时,报错:JSON未定义.如下图:
- Linux系统搭建负载均衡环境
1:负载均衡的定义多台服务器组成一个集群,向外提供相同的服务,所有的请求经过apache服务器的分配,到各台tomcat服务器处理请求.另外还需实现session共享,如果有一台tomcat服务器宕机 ...