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

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

1.链接地址:

http://poj.org/problem?id=1936

http://bailian.openjudge.cn/practice/1936

2.题目:

All in All
Time Limit: 1000MS   Memory Limit: 30000K
Total Submissions: 26651   Accepted: 10862

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 subsequenceperson compressionVERDI vivaVittorioEmanueleReDiItaliacaseDoesMatter CaseDoesMatter

Sample Output

YesNoYesNo

Source

3.思路:

 

4.代码:

1 #include "stdio.h" 2 //#include "stdlib.h" 3 #include "string.h" 4 #define NUM 100002 5 char s[NUM],t[NUM]; 6 int main() 7 { 8     int i,j; 9     int len_s,len_t;10     while(scanf("%s%s",s,t) != EOF)11     {12         len_s=strlen(s);13         len_t=strlen(t);14         i=0;j=0;15         while(i
=len_s) printf("Yes\n");22 else printf("No\n");23 }24 //system("pause");25 return 0;26 }

 

转载于:https://www.cnblogs.com/mobileliker/p/3576774.html

你可能感兴趣的文章
[译]集群调度架构的变革 (三)
查看>>
JavaScript设计模式与开发实践 - 观察者模式
查看>>
node学习
查看>>
sublime当中创建自定义代码段
查看>>
【前端学习】-margin
查看>>
GitChat · 架构 | 从订单中心开始,聊“多KEY”类业务数据库水平切分架构实践...
查看>>
前端每周清单第 28 期:JS 运行原理与优化,高性能 CSS 引擎,Coursera GraphQL 实践...
查看>>
lombok的使用
查看>>
Ubuntu+phpstorm+firefox+xdebug的配置
查看>>
python小记
查看>>
带着问题学 Kubernetes 抽象对象 Service
查看>>
原理解释 - 收藏集 - 掘金
查看>>
剖析Laravel队列系统--准备队列作业
查看>>
用vue-cli创建vue项目的一个坑
查看>>
书单记录,方便后面自己买书
查看>>
用 husky 和 lint-staged 构建超溜的代码检查工作流
查看>>
移动APP中那些关乎用户体验的测试项
查看>>
MailBee.NET Objects发送电子邮件(SMTP)教程二:SMTP认证
查看>>
前端面试题:从url到页面展现,这之中发生了什么?
查看>>
sublime打开TXT文件乱码的问题
查看>>