All in All - poj 1936 (子串)
#include <iostream>
#include <string.h>
using namespace std;
char s[];
char t[];
int main() { while(cin>>s>>t){
int length1=strlen(s);
int length2=strlen(t);
int i=,j=;
for(i=,j=;i<length1&&j<length2;){
if(s[i]==t[j]){
i++;
j++;
}else{
j++;
}
}
if(i==length1)
cout<<"Yes"<<endl;
else
cout<<"No"<<endl;
}
return ;
}
附:
Time Limit: 1000MS | Memory Limit: 30000K | |
Total Submissions: 29592 | Accepted: 12269 |
Description
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
Output
Sample Input
sequence subsequence
person compression
VERDI vivaVittorioEmanueleReDiItalia
caseDoesMatter CaseDoesMatter
Sample Output
Yes
No
Yes
No
All in All - poj 1936 (子串)的更多相关文章
- POJ 1936 All in All(模拟)
All in All 题目链接:http://poj.org/problem?id=1936 题目大意:判断从字符串s2中能否找到子串s1.字符串长度为10W. Sample Input sequen ...
- POJ 1936 All in All 匹配, 水题 难度:0
题目 http://poj.org/problem?id=1936 题意 多组数据,每组数据有两个字符串A,B,求A是否是B的子串.(注意是子串,也就是不必在B中连续) 思路 设置计数器cnt为当前已 ...
- OpenJudge/Poj 1936 All in All
1.链接地址: http://poj.org/problem?id=1936 http://bailian.openjudge.cn/practice/1936 2.题目: All in All Ti ...
- poj 1936 All in All(水题)
题目链接:http://poj.org/problem?id=1936 思路分析:字符串子序列查找问题,设置两个指针,一个指向子序列,另一个指向待查找的序列,查找个字符串一次即可判断.算法时间复杂度O ...
- poj 1936 All in All
All in All Time Limit: 1000 MS Memory Limit: 30000 KB 64-bit integer IO format: %I64d , %I64u Java ...
- Poj 1936,3302 Subsequence(LCS)
一.Description(3302) Given a string s of length n, a subsequence of it, is defined as another string ...
- POJ 1936
#include<iostream> #include<string> using namespace std; int main() { //freopen("ac ...
- 简单的字符串比较题 POJ 1936
Description You have devised a new encryption technique which encodes a message by inserting between ...
- POJ 1936 All in All(串)
All in All Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 27537 Accepted: 11274 Descript ...
随机推荐
- 线程协作-Semaphore并发限制
Semaphore(信号量)是用来控制同时访问特定资源的线程数量,它通过协调各个线程,以保证合理的使用公共资源.
- win10 彻底删除mysql步骤
转载自:https://blog.csdn.net/sxingming/article/details/52601250 1. 停止MySQL服务 开始->所有应用->Windows管理工 ...
- HTTP协议下保证登录密码不被获取最健壮方式
原文:http://www.cnblogs.com/intsmaze/p/6009648.html HTTP协议下保证登录密码不被获取最健壮方式 说到在http协议下用户登录如何保证密码安全这个问 ...
- ActiveMQ实战-集群
原文:http://blog.csdn.net/lifetragedy/article/details/51869032 ActiveMQ的集群 内嵌代理所引发的问题: 消息过载 管理混乱 如何解决这 ...
- 消息队列系列(四):Rabbitmq常用命令行
目录:安装目录下的 ./sbin rabbitmqctl [-n node] [-t timeout] [-q] {command} [command options…] http://www.rab ...
- vs 代理登入
https://msdn.microsoft.com/zh-cn/vstudio/dn771556.aspx
- ajax请求不能下载文件(转载)
最近在做文件下载,后台写了个控制层,直接走进去应该就可以下载文件,各种文件图片,excel等 但是起初老是下载失败,并且弹出下面的乱码: 前台请求代码: $('#fileexcel').unbind( ...
- Less使用说明
使用koala编译 Koala 是一款由国人开发的开源预处理语言图形编译工具,目前已支持 Less.Sass.Compass 与CoffeeScript. 目前支持以下系统:Windows,Mac, ...
- JavaScript中的bind方法及其常见应用
一.bind()方法的实现 在JavaScript中,方法往往涉及到上下文,也就是this,因此往往不能直接引用.就拿最常见的console.log("info…")来说,避免书写 ...
- 一起來玩鳥 Starling Framework(7)MovieClip
承上一篇,我們接著來講最後一個IAnimatable類別,MovieClip.Starling的MovieClip跟native的MovieClip不太一樣,它只能接收一個Vector.<Tex ...