博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
POJ 1936 All in All
阅读量:6683 次
发布时间:2019-06-25

本文共 1365 字,大约阅读时间需要 4 分钟。

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
题目要求就是在s2中找字串s1!

#include 
#include
#include
#include
using namespace std;char a[100005],b[100005];int main(){ while(~scanf("%s",a)){ scanf("%s",b); int a_length = strlen(a); int b_length = strlen(b); int a1,b1=0; int i; for(i=0;i

转载地址:http://hzoao.baihongyu.com/

你可能感兴趣的文章
Linux环境下段错误的产生原因及调试方法小结
查看>>
[BZOJ 1502][NOI2005]月下柠檬树(自适应Simpson积分)
查看>>
initialize方法与load方法比较
查看>>
一致性hash算法及其java实现
查看>>
Arraylist和linkedlist的区别(JDK源码阅读)
查看>>
PHP常见的加密技术
查看>>
Asp.net读取AD域信息的方法(一)
查看>>
两道题学习动态规划
查看>>
php-fpm使用
查看>>
OpenGL ES 入门之旅--OpenGL 下的坐标系和着色器渲染流程
查看>>
c# 扫雷游戏制作步骤
查看>>
mysql实战31 | 误删数据后除了跑路,还能怎么办?
查看>>
Android Q Labs | Android Q 手势导航
查看>>
.net Core 依赖注入 Add********说明
查看>>
Treap
查看>>
ASP.NET MVC Razor
查看>>
Subscribe的第四个参数用法
查看>>
零值比较--BOOL,int,float,指针变量与零值比较的if语句
查看>>
vue-cli的项目加入骨架屏
查看>>
c#获取电脑硬件信息参数说明(硬盘篇 Win32_DiskDrive)
查看>>