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 ...
随机推荐
- iOS连续上传多张图片
参考地址:http://www.cocoachina.com/ios/20180730/24366.html 需求是怎样的:for 循环里面.多个网络请求上传图片,每次上传一张,至于为什么每次只上传一 ...
- XtraBackup完整备份与增量备份的原理
MySQL数据库实现备份的操作包括完整备份和增量备份等,本文我们主要介绍一下增量备份和完整备份的原理,接下来我们就一起来了解一下这部分内容. 完整备份的原理: 对于InnoDB,XtraBackup基 ...
- Selenium定位元素-Xpath的使用方法
工具 Xpath的练习建议下载火狐浏览器,下载插件Firebug.Firepath. 由于最新版火狐不支持Firebug等扩展工具了,所以需要下载49版以下的版本安装https://ftp.mozil ...
- soapUI-Groovy Script
1.1.1 Groovy Script soapUI通过以groovy语言编写的脚本来大量支持您的项目. Groovy脚本TestSteps可用于向功能TestCase添加任意功能. 脚本断言用于任 ...
- TempData["a"]多个Action方法之前共享数据
ViewData["a"]只可以在自己视图的页面里被访问,但TempData["a"]可以多个Action方法之前共享数据,比如在 @{Html.RenderA ...
- ReactNative前端开发者
ReactNative前端开发者 文档版本0.0.2 Author: Necfol 说明: 本文档用于指导前端React Native的开发,如需开发其他其他框架应用,不适用本文档 前期准备 Reac ...
- yii的url写法
Yii 各种url地址写法 echo Url::home(); 生成入口地址/yii2test/frontend/web/index.php: echo Url::base();生成入口文件夹地址: ...
- python+Django框架运用(四)
Django后台管理 基本配置 默认登录地址:http://127.0.0.1:8000/admin 创建后台管理员: python3 ./manage.py createsuperuser # ...
- 【Redis学习之十】Redis集群维护
Redis集群增删节点部署环境 redis-3.0.0 VM虚拟机redhat6.5-x64:192.168.1.201.192.168.1.202.192.168.1.203. ...
- python getatime() 查看文件的访问时间
import time,os def main(): file_name=r'C:\Temp\Req.xml' file_times_access=time.localtime(os.path.get ...