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个数字出现 ...
随机推荐
- webdriver 启动chrome时加载配置
Selenium操作浏览器是不加载任何配置的,网上找了半天,关于Firefox加载配置的多点,Chrome资料很少,下面是关于加载Chrome配置的方法: 一.加载所有Chrome配置 用Chrom ...
- ALGO-145_蓝桥杯_算法训练_4-1打印下述图形
记: 这里用到了printf("%*s%s%*s\n",n-i,"",arr,n-i,"");的写法, 其中%*s中的*代表该字符串s的个数 ...
- 高精度算r的n次方 问题 H: 乾隆巡江南
问题 H: 乾隆巡江南 时间限制: 2 Sec 内存限制: 128 MB提交: 13 解决: 3[提交][状态][讨论版] 题目描述 话说乾隆带着他的宰相刘罗锅和你出巡江南,被杭州城府邀请去听戏, ...
- [转][C#]降级.net 源码4.5
来自:https://www.cnblogs.com/had37210/p/8057042.html 主要是 Task 的降级: 1.net4.5.2 引入了 async/await 关键字. 这个其 ...
- UnicodeString基本操作(Ring0)
#include "Unicode_String_Ring0.h" //bp Unicode_String_Ring0!DriverEntry NTSTATUS DriverEnt ...
- 制作OpenStack云平台centos6.5镜像
创建虚拟镜像 # qemu-img create -f raw Cloud_Centos6.5_64bit.img 10G [root@localhost ~]# ll /opt/CentOS-6.5 ...
- static--Android静态变量使用陷阱
相关资料:http://blog.csdn.net/ctcwri/article/details/8858414 http://blog.csdn.net/w ...
- SCCM2012 R2实战系列之十二:解决OSD分发时间过长的问题
对于SCCM 2012 R2的初学者来说,能够成功分发操作系统可能已经是非常兴奋了.但在企业中会遇到客户提出的各种各样苛刻的需求.所以在平时实验过程中多站点客户的角度想问题,尽可能的贴近企业实际生产环 ...
- orcale 函数wm_concat不存咋lob值使用zh_concat 替换
create or replace TYPE zh_concat_im AUTHID CURRENT_USER AS OBJECT ( CURR_STR VARCHAR2(32767), STATIC ...
- Go语言 函数,工程管理
Go语言 函数,工程管理 1.无参无返回值函数的使用 package main import "fmt" func main() { // 无参无返回值函数的调用:函数名() fu ...