POJ--1936 All in All(水题,暴力即可)
All in All Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 30543 Accepted: 12723 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 <algorithm>
#include <math.h>
#include <stdlib.h>
using namespace std;
#define MAX 100000
char a[MAX+5];
char b[MAX+5];
int main()
{
int pos;
bool res;
while(scanf("%s%s",&a,&b)!=EOF)
{
pos=-1;
res=true;
int tag;
int len1=strlen(a);
int len2=strlen(b);
for(int i=0;i<len1;i++)
{
tag=0;
for(int j=0;j<len2;j++)
{
if(a[i]==b[j])
{
if(j>pos)
{
tag=1;
pos=j;
break;
}
}
}
if(tag==0)
res=false;
}
if(res==true)
printf("Yesn");
else
printf("Non");
}
}
- Dora.Interception: 一个为.NET Core度身定制的AOP框架
- 为了支持AOP的编程模式,我为.NET Core写了一个轻量级的Interception框架[开源]
- 关于Expression Tree和IL Emit的所谓的"性能差别"
- 采用一个自创的"验证框架"实现对数据实体的验证[扩展篇]
- 采用一个自创的"验证框架"实现对数据实体的验证[改进篇]
- Flash XSS检测脚本的简单实现
- 采用一个自创的"验证框架"实现对数据实体的验证[设计篇]
- 采用一个自创的"验证框架"实现对数据实体的验证[编程篇]
- 谈谈你最熟悉的System.DateTime[上篇]
- 12步轻松搞定Python装饰器
- 实用小工具,教你轻松转化Python通用数据格式
- 数据工程师常用的几个小工具(附python源代码)
- R语言的三种聚类方法
- 技能 | R语言的igraph画社交关系图示例
- JavaScript 教程
- JavaScript 编辑工具
- JavaScript 与HTML
- JavaScript 与Java
- JavaScript 数据结构
- JavaScript 基本数据类型
- JavaScript 特殊数据类型
- JavaScript 运算符
- JavaScript typeof 运算符
- JavaScript 表达式
- JavaScript 类型转换
- JavaScript 基本语法
- JavaScript 注释
- Javascript 基本处理流程
- Javascript 选择结构
- Javascript if 语句
- Javascript if 语句的嵌套
- Javascript switch 语句
- Javascript 循环结构
- Javascript 循环结构实例
- Javascript 跳转语句
- Javascript 控制语句总结
- Javascript 函数介绍
- Javascript 函数的定义
- Javascript 函数调用
- Javascript 几种特殊的函数
- JavaScript 内置函数简介
- Javascript eval() 函数
- Javascript isFinite() 函数
- Javascript isNaN() 函数
- parseInt() 与 parseFloat()
- escape() 与 unescape()
- Javascript 字符串介绍
- Javascript length属性
- javascript 字符串函数
- Javascript 日期对象简介
- Javascript 日期对象用途
- Date 对象属性和方法
- Javascript 数组是什么
- Javascript 创建数组
- Javascript 数组赋值与取值
- Javascript 数组属性和方法
- Python爬取某宝商品数据案例:100页的价格、购买人数等数据
- 如何让你的图片加上一层天气的特效?Python帮你解决(附源码)
- Python最简单的图片爬虫,20行代码带你爬遍整个网站
- 用Python把人物头像动漫化,不同的表情给你不同的惊喜
- python苦短-爬取音乐
- python苦短-灵笼说啥
- python爬虫-八佰词云
- python爬虫-beautifulsoup使用
- 深度学习-卷积神经网络原理
- 深度理论VGG-NET 网络
- 只要30行代码!7步教会你Python爬取网页抖音热门视频
- python苦短-CV2
- python实现语音在线合成,让你的小说自己念给你听
- Python爬虫实战:模拟登录淘宝网站
- Python制作动态二维码(附源码,复制再贴修改路径名字即可)