uva 10340 All in All
水题,从头到尾扫一遍就可以了,输入两个字符串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的更多相关文章
- 贪心水题。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 ...
- UVA 10340 (13.08.25)
Problem E All in All Input: standard input Output: standard output Time Limit: 2 seconds Memory Limi ...
- UVa 10340 子序列
https://vjudge.net/problem/UVA-10340 题意: 输入两个字符串s和t,判断是否可以从t中删除0个或多个字符得到字符串s. 思路: 很水的题... #include&l ...
- UVa 10340 All in All (水题,匹配)
题意:给定两个字符串,问第一个串能不能从第二个串通过删除0个或多个字符得到. 析:那就一个字符一个字符的匹配,如果匹配上了就往后走,判断最后是不是等于长度即可. 代码如下: #include < ...
- UVA 10340 All in All(字符串,朴素匹配)
#include <stdio.h> #include <algorithm> #include <cstring> using namespace std; ], ...
- 【习题 3-9 UVA - 10340】All in All
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 相当于让你判断s1是不是s2的子序列. for一遍就好 [代码] #include <bits/stdc++.h> us ...
- 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 ...
随机推荐
- 判断CAD版本
使用命令: ACADVER ACADVER = "17.2s (LMS Tech)" (只读) CAD2016 ACADVER = "20.1s (LMS Tech)&q ...
- 2015-微软预科生计划-面试题-Swimming Plans
http://hihocoder.com/problemset/problem/1188 题目大意 Steven在时刻T到达了室内游泳池. 游泳池一共有N条泳道,游泳池两侧分别标记为0和1. 已知除了 ...
- 2016 - 1- 24 大文件下载 关于NSOutStream 的使用补充
// // ViewController.m // 大文件下载 // // Created by Mac on 16/1/24. // Copyright © 2016年 Mac. All right ...
- qt5.4 msvc2013_64安装 目标计算机不匹配问题
本文主要解决一个问题:即在安装完成之后如下目标计算机不匹配问题. ------------------------------------------------------------------ ...
- 根据地图上的两个点各自的x,y坐标,计算出2点之间的直线距离。显示为公里、米
/** * calc_map_distance() , 根据地图上的两个点各自的x,y坐标,计算出2点之间的直线距离 * @param array $point_1 第1个点的x,y坐标 array( ...
- js实现时间控件
<html><head> <title>时间控件</title></head><body > <input name=&q ...
- Python UDP broadcast PermissionError: [Errno 13] Permission denied
/********************************************************************** * Python UDP broadcast Permi ...
- day5--<装饰器、模块、字符串格式化、生成器、迭代器>logging模块
本节大纲: 一:双层装饰器:一个函数可以被多层装饰器进行装饰,函数渲染(编译)从下到上,函数执行从上到下.如下程序: #!/usr/bin/env python #-*-coding:utf-8-*- ...
- meta-analysis 到底是什么个意思类?
背景 科学研究应建立于许多实验结果的重复之上,除了少数新发现外,单个实验结果很难对科学的发展作出极为显著的贡献.所以为了阐明某一主题,在许多科学领域有众多研究者在对不同的实验对象或对同一对象在不同的实 ...
- pyhton 27 pip命令无法使用 没有Scripts文件夹 的解决方法
1 安装了setuptools http://jingyan.baidu.com/article/fb48e8be52f3166e622e1400.html 2 用ez_setup.py安装了setu ...