水题,从头到尾扫一遍就可以了,输入两个字符串s和t,判断是否可以从t中删除0个或多个字符(其他字符顺序不变),得到字符串s。例如,abcde可以得到bce,但无法得到dc。

#include<algorithm>
#include<cstring>
#include<cstdio>
#include<iostream>
#define len 101000 using namespace std; char s[len], t[len]; int main()
{
int sn, tn, ls, lt;
while (cin >> s) {
cin >> t;
ls = strlen(s);
lt = strlen(t);
sn = ;tn = ;
for (int i = ;i < ls, i < lt;i++) {
if (s[sn] == t[tn]) {
sn++;
tn++;
}
else {
tn++;
}
}
if (sn == ls)cout << "Yes" << endl;
else cout << "No" << endl;
}
return ;
}

uva 10340 All in All的更多相关文章

  1. 贪心水题。UVA 11636 Hello World,LA 3602 DNA Consensus String,UVA 10970 Big Chocolate,UVA 10340 All in All,UVA 11039 Building Designing

    UVA 11636 Hello World 二的幂答案就是二进制长度减1,不是二的幂答案就是是二进制长度. #include<cstdio> int main() { ; ){ ; ) r ...

  2. UVa 10340 - All in All 水题 难度: 0

    题目 https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&a ...

  3. UVA 10340 (13.08.25)

    Problem E All in All Input: standard input Output: standard output Time Limit: 2 seconds Memory Limi ...

  4. UVa 10340 子序列

    https://vjudge.net/problem/UVA-10340 题意: 输入两个字符串s和t,判断是否可以从t中删除0个或多个字符得到字符串s. 思路: 很水的题... #include&l ...

  5. UVa 10340 All in All (水题,匹配)

    题意:给定两个字符串,问第一个串能不能从第二个串通过删除0个或多个字符得到. 析:那就一个字符一个字符的匹配,如果匹配上了就往后走,判断最后是不是等于长度即可. 代码如下: #include < ...

  6. UVA 10340 All in All(字符串,朴素匹配)

    #include <stdio.h> #include <algorithm> #include <cstring> using namespace std; ], ...

  7. 【习题 3-9 UVA - 10340】All in All

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 相当于让你判断s1是不是s2的子序列. for一遍就好 [代码] #include <bits/stdc++.h> us ...

  8. UVA 10340 - All in All 水~

    看题传送门 Problem E All in All Input: standard input Output: standard output Time Limit: 2 seconds Memor ...

  9. All in All UVA - 10340

     You have devised a new encryption technique which encodes a message by inserting between its charac ...

随机推荐

  1. C语言程序设计第一次作业

    同学们,我们已经留了两次实验了,请大家将这两次的实验课内容写成实验报告在截止日期前进行提交. 截止日期:2016-10-7 23:00 实验一: 编程打印5行的倒三角形,第一行打印9个*,第二行7个* ...

  2. LR手工制作webServices接口类脚本

    首先通过抓包获得某个接口的码流消息,请求报文码分消息头和消息体,所以在制作脚本的时候也需要添加消息头和消息体. POST /jboss-bet/services/&** HTTP/1.1SOA ...

  3. Day3 summary

    今天主要学习了K-means算法,又过了遍Andrew教授的coursera视频,弄明白了Action书上的算法.困难出现在实例练习,申请Yahoo place finder API获得了appid, ...

  4. js:setTimeout 与 setInterval 比较

    在javascript中有两个非常有用的函数:setTimeout 和setInterval ,都是定时器:但是两者存在着一些区别: 1. setTimeout函数 用法:setTimeout(fn, ...

  5. C++ Daily 《1》----关于对象

    1. 问题 请问如下的一个 class 的一个对象占了多少内存? 具体包含哪些东西? non-static 变量? static member 变量? member function?? virtua ...

  6. RabbitMQ/JAVA 客户端连接测试

    这里是一个简单的helloworld测试. 这里在eclipse平台中实现 细节不再赘述.重点是导入rabbitmq-java-client的jar包 下载地址:http://www.rabbitmq ...

  7. JMeter学习(十)内存溢出解决方法

    使用jmeter进行压力测试时遇到一段时间后报内存溢出outfmenmory错误,导致jmeter卡死了,先尝试在jmeter.bat中增加了JVM_ARGS="-Xmx2048m -Xms ...

  8. 关于Python脚本开头两行的:#!/usr/bin/python和# -*- coding: utf-8 -*-的作用 – 指定文件编码类型

    #!/usr/bin/python指定用什么解释器运行脚本以及解释器所在的位置 # -*- coding: utf-8 -*-用来指定文件编码为utf-8的PEP 0263 -- Defining P ...

  9. LintCode Search Insert Position

    找出指定target的位置(没有此数时为按顺序应当位置). public class Solution { /** * param A : an integer sorted array * para ...

  10. JavaBean基本用法示例(一)

    一.首先创建一个类person,里面有四个成员:name,sex,age,info,添加四个成员所有的set和get方法. package com.kaly.bean; public class pe ...