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. Laravel 5 : Call to undefined function Illuminate\Foundation\Bootstrap\mb_internal_encoding()

    自己组装的apache,php,mysql phpinfo显示 OpenSSL support     disabled (install ext/openssl) 判断为权限问题,所以修改如下. 1 ...

  2. js日期转换Fri Oct 31 18:00:00 UTC+0800 2008转换为yyyy-mm-dd

    Date.prototype.Format = function (fmt) { var o = { "M+": this.getMonth() + 1, //月份 "d ...

  3. 14、SpringBoot------定制错误返回内容json格式

    开发工具:STS 前言: 在前后端分离的项目中,当前端向后端请求资源失败时,想知道具体的错误原因,给用户予以提示. 但是,在springboot中返回内容是固定的.并不适合我们前端进行分析. 所以,就 ...

  4. javaWeb基础 javascript bom5个对象

    bom 也称为浏览器对象 browser object model(浏览器对象模型),由五个对象组成:        Window:浏览器窗口 最顶层对象.       Navigator :浏览器对 ...

  5. 友盟分享小结 - iOS

    因之前都写在了 AppDelegate 类中,看起来过于臃肿,此次基于友盟分享重新进行了一次优化,此次分享内容基于已经成功集成 SDK 后 code 层级部分.注:此次分享基于 SDK 6.9.3,若 ...

  6. easyui基于 layui.laydate日期扩展组件

    本人后端开发码农一个,公司前端忙的一逼,项目使用的是easyui组件,其自带的datebox组件使用起来非常不爽,主要表现在 1.自定义显示格式很麻烦 2.选择年份和月份用户体验也不好 网上有关于和M ...

  7. Leetcode463. Island Perimeter

    题目 给定一个包含 0 和 1 的二维网格地图,其中 1 表示陆地 0 表示水域. 网格中的格子水平和垂直方向相连(对角线方向不相连).整个网格被水完全包围,但其中恰好有一个岛屿(或者说,一个或多个表 ...

  8. OCCI结果集(ResultSet)性能优化

    对于ResultSet类中的next()方法,默认是一次检索一行数据,及一次检索执行一次网络往返,当结果集数量大时,效率低:对此OCCI提供了几种改善方法,即:在一次网络往返返回多行数据. 1. 通过 ...

  9. LVM(扩展)

    LVM(扩展)======================== [root@aminglinux newdir]# fdisk -l /dev/sdb 磁盘 /dev/sdb:10.7 GB, 107 ...

  10. JAVAOOP异常

    排序: Try-catch-finally:try正常执行,如果有异常执行catch后执行finally,如果没有直接执行finally 执行顺序:try-catch:try中的语句正常执行,如果遇到 ...