UVa 10340 子序列
https://vjudge.net/problem/UVA-10340
题意:
输入两个字符串s和t,判断是否可以从t中删除0个或多个字符得到字符串s。
思路:
很水的题...
#include<iostream>
#include<string>
#include<cstring>
using namespace std; string s, t; int main()
{
//freopen("D:\\txt.txt", "r", stdin);
while (cin >> s >> t)
{
int l1 = s.size();
int l2 = t.size();
int p1 = , p2 = ;
while (p1 < l1 && p2 < l2)
{
if (s[p1] == t[p2])
{
p1++;
p2++;
}
else
p2++;
}
if (p1 == l1) cout << "Yes" << endl;
else cout << "No" << endl;
}
}
UVa 10340 子序列的更多相关文章
- 贪心水题。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 ...
- UVa 10340 - All in All 水题 难度: 0
题目 https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&a ...
- 【习题 3-9 UVA - 10340】All in All
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 相当于让你判断s1是不是s2的子序列. for一遍就好 [代码] #include <bits/stdc++.h> us ...
- uva 10340 All in All
水题,从头到尾扫一遍就可以了,输入两个字符串s和t,判断是否可以从t中删除0个或多个字符(其他字符顺序不变),得到字符串s.例如,abcde可以得到bce,但无法得到dc. #include<a ...
- UVA 10340 (13.08.25)
Problem E All in All Input: standard input Output: standard output Time Limit: 2 seconds Memory Limi ...
- UVa 10340 All in All (水题,匹配)
题意:给定两个字符串,问第一个串能不能从第二个串通过删除0个或多个字符得到. 析:那就一个字符一个字符的匹配,如果匹配上了就往后走,判断最后是不是等于长度即可. 代码如下: #include < ...
- UVA 10340 All in All(字符串,朴素匹配)
#include <stdio.h> #include <algorithm> #include <cstring> using namespace std; ], ...
- UVA 10340 - All in All 水~
看题传送门 Problem E All in All Input: standard input Output: standard output Time Limit: 2 seconds Memor ...
- All in All UVA - 10340
You have devised a new encryption technique which encodes a message by inserting between its charac ...
随机推荐
- PHP Warning: preg_match(): JIT compilation failed: no more memory in
PHP7.3出现如下错误:PHP Warning: preg_match(): JIT compilation failed: no more memory in ... 解决方案: 修改 /usr/ ...
- Apache 配置多个HTTPS站点
作中经常会遇到多个站点实现https访问,并指向同一个网页,本文将详解如何在Centos 环境下配置Apache多站点实现HTTPS访问. 准备工作 OS:CentOS release 6.8 (Fi ...
- SSM请求的响应
1.请求响应文本到页面直接用pw.println("文本信息");打印到页面: 2.如果请求方法前不加@ResponseBody,返回字符串直接转发到对应的页面: 3.如果请求方法 ...
- SVM入门——线性分类器的求解,核函数
一.问题的描述 从最一般的定义上说,一个求最小值的问题就是一个优化问题(也叫寻优问题,更文绉绉的叫法是规划——Programming),它同样由两部分组成,目标函数和约束条件,可以用下面的式子表示: ...
- [LeetCode] 53. Maximum Subarray_Easy tag: Dynamic Programming
Given an integer array nums, find the contiguous subarray (containing at least one number) which has ...
- sqlplus与shell互相传值的几种情况
2578人阅读 sqlplus与shell互相传值的几种情况 情况一:在shell中最简单的调用sqlplus $cat test.sh #!/bin/sh sqlplus oracle/orac ...
- 2018-2019-2 网络对抗技术 20165324 Exp3:免杀原理与实践
2018-2019-2 网络对抗技术 20165324 Exp3:免杀原理与实践 免杀原理及基础问题回答 免杀 1. 一般是对恶意软件做处理,让它不被杀毒软件所检测.也是渗透测试中需要使用到的技术. ...
- Oracal 11 g 数据库安装
一:下载安装包 http://www.oracle.com/technetwork/cn/database/enterprise-edition/downloads/112010-win64soft- ...
- HTTP 头和 PHP header() 函数
http://unifreak.github.io/translation/Http_headers_and_PHP_header()_function 引言 许多初级到中级的的 PHP 程序员把 h ...
- NC_Verilog中的工具ICC
Cadence中的Incisive Comprehensive Coverage(ICC) solusion提供在仿真中的覆盖率分析. ICC中的覆盖率类型有两大类: 1)Code Coverage: ...