uva-10340-水题
题意:字符串匹配,看样例输入理解题意
直接循环
#include <string>
#include<iostream>
#include<map>
#include<memory.h>
#include<vector>
#include<algorithm>
#include<queue>
#include<vector>
#include<stack>
#include<math.h>
#include<iomanip> namespace cc
{
using std::cout;
using std::endl;
using std::cin;
using std::map;
using std::vector;
using std::string;
using std::sort;
using std::priority_queue;
using std::greater;
using std::vector;
using std::swap;
using std::stack; constexpr double MD = 1e-; void solve()
{
string str1, str2;
while (cin>>str1>>str2)
{
int ok = ;
for (int i=;i<str2.length();i++)
{
if (str2[i] == str1[])
{
int k = ;
for (int j=i+;j<str2.length()&&k<str1.length();j++)
{
if (str2[j] == str1[k])
++k;
}
if (k == str1.length())
{
ok = ;
break;
}
}
}
if (ok)
cout << "Yes" << endl;
else
cout << "No" << endl;
} } }; int main()
{ #ifndef ONLINE_JUDGE
freopen("d://1.text", "r", stdin);
#endif // !ONLINE_JUDGE
cc::solve(); return ;
}
uva-10340-水题的更多相关文章
- UVa 1595 (水题) Symmetry
颓废的一个下午,一直在切水题,(ˉ▽ ̄-) 首先如果这些点是对称的话,那么它们的对称轴就是x = m,m是横坐标的平均值. 把这些点放到一个集合里,然后扫描每个点,计算出它关于x = m的对称点,看这 ...
- UVa 10391 (水题 STL) Compound Words
今天下午略感无聊啊,切点水题打发打发时间,=_=|| 把所有字符串插入到一个set中去,然后对于每个字符串S,枚举所有可能的拆分组合S = A + B,看看A和B是否都在set中,是的话说明S就是一个 ...
- UVa 10935 (水题) Throwing cards away I
直接用STL里的queue模拟即可. #include <cstdio> #include <queue> using namespace std; ; int discard ...
- UVa 1593 (水题 STL) Alignment of Code
话说STL的I/O流用的还真不多,就着这道题熟练一下. 用了两个新函数: cout << std::setw(width[j]); 这个是设置输出宽度的,但是默认是在右侧补充空格 所 ...
- UVa 400 (水题) Unix ls
题意: 有n个文件名,排序后按列优先左对齐输出.设最长的文件名的长度为M,则最后一列长度为M,其他列长度为M+2. 分析: 这道题很简单,但要把代码写的精炼,还是要好好考虑一下的.lrj的代码中有两个 ...
- UVa 11040 (水题) Add bricks in the wall
题意: 45块石头如图排列,每块石头上的数等于下面支撑它的两数之和,求其余未表示的数. 分析: 首先来计算最下面一行的数,A71 = A81 + A82 = A91 + 2A92 + A93,变形得到 ...
- Square Numbers UVA - 11461(水题)
#include <iostream> #include <cstdio> #include <sstream> #include <cstring> ...
- UVa 489 HangmanJudge --- 水题
UVa 489 题目大意:计算机给定一个单词让你猜,你猜一个字母,若单词中存在你猜测的字母,则会显示出来,否则算出错, 你最多只能出错7次(第6次错还能继续猜,第7次错就算你失败),另注意猜一个已经猜 ...
- UVa 1339 Ancient Cipher --- 水题
UVa 1339 题目大意:给定两个长度相同且不超过100个字符的字符串,判断能否把其中一个字符串重排后,然后对26个字母一一做一个映射,使得两个字符串相同 解题思路:字母可以重排,那么次序便不重要, ...
- UVa 1225 Digit Counting --- 水题
UVa 1225 题目大意:把前n(n<=10000)个整数顺次写在一起,12345678910111213...,数一数0-9各出现多少字 解题思路:用一个cnt数组记录0-9这10个数字出现 ...
随机推荐
- Digispark kickstarter + JoyStick 模拟鼠标
IDE:Arduino 1.0.4 一.线路连接 S-Y --> P5(A0) S-X --> P2(A1) S-K --> P0 VCC --> VCC GND --> ...
- MySql 常见错误代码大全 VV2
从机一直1593错误,排查了半天发现是从的配置文件中的server-id没改导致,此低级错误记录下警醒自己 B.1. 服务器错误代码和消息 服务器错误信息来自下述源文件: · 错误消息信息列在shar ...
- .net core 连接sql server 时提示Connection Timeout Expired
.net core开发环境是ubuntu LINUX, 在ubuntu 上 telnet 数据库IP 端口是通的. SQL SERVER 是2008 ,未打SP补丁. 打完 SQL SERVER 2 ...
- IIS7 UNC File caching issue
You have to either choose dir-monitoring and file-change-notification with its drawback of using SMB ...
- java锁在等待唤醒机制中作用
等待的线程放在线程池wait().notify().notifyall()都使用在同步中,因为要对持有监视器(锁)的线程操作.所以要使用在同步中,因为只有同步才具有锁. 为什么这些操作的线程的方法要定 ...
- pytest.2.运行多个文件
From: http://www.testclass.net/pytest/multiple_tests/ 背景 在现实的测试活动中,我们经常会定义多个用例文件,用来实现业务逻辑或其他逻辑上用例的物理 ...
- Hadoop概念学习系列之Java调用Shell命令和脚本,致力于hadoop/spark集群(三十六)
前言 说明的是,本博文,是在以下的博文基础上,立足于它们,致力于我的大数据领域! http://kongcodecenter.iteye.com/blog/1231177 http://blog.cs ...
- ubuntu16.04下sublime text 3之安装和配置
1.安装方法 1)使用ppa安装 sudo add-apt-repository ppa:webupd8team/sublime-text-3 sudo apt-get update sudo apt ...
- [UE4]更通用的接口,将UserWidget作为图标添加到小地图
将图标改成UserWidget添加到小地图,UserWidget支持动画特效,更丰富小地图的功能. 一.在小地图图标结构体中,将Flag数据类型改成UserWidget,删除ImageWidget(类 ...
- Map相关问题
<!--加载地图开始--> <!DOCTYPE html><html><head> <meta charset="UTF-8" ...