加密术
来源:互联网 发布:java short类型 编辑:程序博客网 时间:2024/05/01 20:33
加密术
Time Limit: 1000MS Memory Limit: 65536KB
SubmitStatistic
Problem Description
加密技术是一种常用的安全保密手段,利用加密技术可以把重要的数据变成经过加密变成乱码传送,到达目的地后再利用解密手段还原。现在我们发明了一种新的加密技术,即通过在一个字符串的任意位置插入若干个随机生成的字符(‘a’~’z’或’A’~’Z’)对该字符串加密。
我们想要申请专利,但在这之前,需要做大量的检测。所以有必要编写一个程序判断加密后的字符串经过解密是否是加密前的字符串,即从加密后的字符串中删除若干个字符后剩下的字符串是否可以拼接成加密前的字符串。Can you help us ?
Input
输入包含多组,每组输入两个串(只包含大小写字母)S,T,中间用空格分开。S和T的长度不超过100000。
Output
对于每组输入,如果加密后的字符串解密后与加密前的字符串相同输出“Yes”,否则输出“No”。
Example Input
string StrstringHELLO sdhfHqEiweqLbnLOqwertynomatter nsomatstrfriend FriEendly
Example Output
YesYesNoNo
Hint
Author
pyn
import java.util.*;import java.math.*;public class Main{public static void main(String[] args){Scanner input= new Scanner(System.in);while(input.hasNext()){String s1 = input.next();String s2 = input.next();int i=0,j=0;while(i<s1.length()&&j<s2.length()){if(s1.charAt(i)==s2.charAt(j)){i++;j++;}else{j++;}}if(i==s1.length()){System.out.println("Yes");}else System.out.println("No");}}}
0 0
- 加密术
- 加密术
- 加密术
- 加密术
- 加密术
- 加密术
- 加密术
- 加密术
- 加密术
- 加密术
- java加密枝术
- java加密枝术
- java加密枝术
- 凯撒的加密术
- java加密枝术
- SDUT 加密术
- sdut_java_加密术
- 加密术 oj
- 四种生成和解析XML文档的方法详解(介绍+优缺点比较+示例)
- SQL盲注工具BBQSQL
- demon日常的刷题——贪心(c++版本)
- Android技巧2:登录注册模块解决方案
- 常用字符串处理函数
- 加密术
- switch中能用哪些类型jdk1.7及以上
- 数据库工具类(二)
- ubuntu学习2——window通过winsshd与ubuntu互传文件
- Linux学习40_没有正确安装GNOME电源管理器的默认配置
- Lisp 的本质(2)
- Java stream 文件和IO
- Mudahbet Casino Malaysia weekly Lucky Draw(lucky draw promotion, mudahbet, mudahbet casino malaysia,
- linux-which