All in All

Time Limit: 1000 MS Memory Limit: 30000 KB

64-bit integer IO format: %I64d , %I64u   Java class name: Main

[Submit] [Status] [Discuss]

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 <iostream>
#include <string.h>
#include <stdio.h> using namespace std; int main()
{
long long int i,j; ///int会超
char s1[],s2[];
while(scanf("%s",s1)!=EOF)
{
scanf("%s",s2);
long len1=strlen(s1);
long len2=strlen(s2);
i=;
j=;
while(true)
{
if(i==len1)
{
cout<<"Yes"<<endl;
break;
}
else if(i<len1 && j==len2)
{
cout<<"No"<<endl;
break;
}
if(s1[i]==s2[j])
{
i++;
j++;
}
else
j++;
}
memset(s1,'\0',sizeof(s1));
memset(s2,'\0',sizeof(s2));
}
return ;
}

最新文章

  1. Loadrunner进行接口自动化测试
  2. 使用XSD校验Mybatis的SqlMapper配置文件(2)
  3. link them together by means of pointers
  4. call函数心得
  5. PHP JSON 操作总结
  6. linq中的GroupBy总结
  7. 201521123004 《Java程序设计》第1周学习总结
  8. Linux下Apache服务的查看和启动
  9. 基于springboot搭建的web系统架构
  10. tensorflow 经典教程及案例
  11. mysql集群搭建--韩国庆
  12. hdu-1115 计算几何 求重心 凸多边形 面积
  13. RabbitMQ学习笔记2-理解消息通信
  14. nohup和&amp; 区别
  15. LoadRunner做性能测试 从设计到分析执行
  16. IIS 7 反向代理 URL重写 转发动态请求
  17. 【转】VC++ 也有 Refactoring 功能了
  18. MySQL优化Explain命令简介(二)
  19. Linux 150命令之查看文件及内容处理命令 cat tac less head tail cut
  20. Alpha版发布 - 感谢有你们

热门文章

  1. 你需要知道的swift必备函数 map
  2. Reprot中的五个Trigger说明
  3. PHPDocument 代码注释规范总结
  4. div一直浮动在页面的底部
  5. 更好更快更高效解析JSON说明
  6. Unity协程(Coroutine)管理类——TaskManager工具分享
  7. JS常见问题
  8. Mosquitto-Ubuntu 14.04快速安装问题解决
  9. SER SERVER存储过程
  10. Oracle SQL优化一(常见方法)