All in All
Time Limit: 1000MS   Memory Limit: 30000K
Total Submissions: 29651   Accepted: 12312

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
#include<string.h>
#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
char s[],t[];
int main(){
while(scanf("%s %s",s,t)!=EOF){
getchar();
int len1=strlen(s);
int len2=strlen(t);
int ans=;
for(int i=;i<len2;i++){
if(s[ans]==t[i]){
ans++;
}
}
if(ans==len1)
printf("Yes\n");
else printf("No\n");
memset(s,,sizeof(s));
memset(t,,sizeof(t));
}
return ;
}

poj1936 假期计划第一水的更多相关文章

  1. hihoCoder#1698 : 假期计划 组合数

    题面:hihoCoder#1698 : 假期计划  组合数 题解: 题目要求是有序的排列,因此我们可以在一开始就乘上A!*B!然后在把这个序列划分成很多段. 这样的话由于乘了阶乘,所以所有排列我们都已 ...

  2. hihocoder #1698 假期计划 (排列组合+费马小定理+乘法逆元)

    Description 小Ho未来有一个为期N天的假期,他计划在假期中看A部电影,刷B道编程题.为了劳逸结合,他决定先拿出若干天看电影,再拿出若干天刷题,最后再留若干天看电影.(若干代指大于0)  每 ...

  3. [No000016]为什么假期计划总是做不到?

  4. [USACO13DEC]假期计划(黄金)Vacation Planning (gold)

    题目翻译不好,这里给出一份 题目背景 Awson是某国际学校信竞组的一只大佬.由于他太大佬了,于是干脆放弃了考前最后的集训,开车(他可是老司机)去度假.离开学校前,他打开地图,打算做些规划. 题目描述 ...

  5. 洛谷P3094 [USACO13DEC]假期计划Vacation Planning

    题目描述 有N(1 <= N <= 200)个农场,用1..N编号.航空公司计划在农场间建立航线.对于任意一条航线,选择农场1..K中的农场作为枢纽(1 <= K <= 100 ...

  6. c++ imooc自学计划

    一.视频学习相关的课程列表: C++远征之起航篇http://www.imooc.com/learn/342: C++远征之离港篇http://www.imooc.com/learn/381: C++ ...

  7. JavaScript和jQuery的学习

    还有12天就要回学校了,我的假期计划还能实现吗?在这12天里,需要把JavaScript和jQuery学完.我知道这两个技术对于前端网页开发非常重要.前期把HTML和CSS学完了,学的不是特别深,只是 ...

  8. [Offer收割]编程练习赛48

    题目1 : 折线中点 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 给定平面上N个点P1, P2, ... PN,将他们按顺序连起来,形成一条折线. 请你求出这条折线的 ...

  9. 【Luogu】P3745期末考试(三分)

    题目链接 我是怎么把“期末考试”在本地写成“假期计划”的 qwq???? 本题把学生和卷子都排个序,按出成绩最晚时间三分. 三分之后可以O(n)的时间统计答案,因为修改卷子出成绩的时间可以贪心计划. ...

随机推荐

  1. 实现一个clone函数,对javascript中的5种数据类型进行值复制

    <!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  2. 使用Hbuild打包APP

    前端开发APP,从HBuilder开始~   内容简介 介绍目前前端人员开发app的几种方法,具体介绍hbuilder开发app,一扇赞新的大门~ 无所不能的js 最开始js仅仅局限于网页上一些效果, ...

  3. 基于 win7下虚拟机的 GNSS-SDR安装过程

    最近在安装 GNSS-SDR软件时,遇到了很多问题,这里回顾了我的安装过程,罗列了所遇到的问题和解决办法.希望后来者不要再踩这些坑了! 首先,在官方文档中看到,GNSS-SDR目前并不支持直接在 Wi ...

  4. hdu_1573_X问题 (分段之中国剩余

    求在小于等于N的正整数中有多少个X满足:X mod a[0] = b[0], X mod a[1] = b[1], X mod a[2] = b[2], …, X mod a[i] = b[i], … ...

  5. 腾讯云负载均衡CLB

    负载均衡 使用场景: ①购买一个负载均衡LB实例 ②一级.二级域名都解析到VIP上 ③创建HTTP/HTTPS监听器 ④绑定云主机 在nginx中只需要配置好伪静态和相关设置就ok了

  6. thymeleaf单选回显,多选回显,选回显,下拉默认选中第一个

    //默认选中第一个<input type ="radio" name="repaymentType" th:each ="repaymentTy ...

  7. dom技术解析xml下jaxp解析器详细代码

    1.使用jaxp实现查询操作 person.xml <?xml version="1.0" encoding="UTF-8" standalone=&qu ...

  8. 事件监听和window.history以及自定义创建事件

    1.事件监听window.addEventListener方法: Window.addEventListener(event, function, useCapture); useCapture:表示 ...

  9. 用 js 写一个获取随机颜色的程序

    function getColor(){ var color="#"; for(var i=0;i<6;i++){ color+=(Math.random()*16 | 0) ...

  10. PHP处理mysql事务

    MYSQL的事务处理主要有两种方法.1.用begin,rollback,commit来实现begin 开始一个事务rollback 事务回滚commit 事务确认2.直接用set来改变mysql的自动 ...