UVALive 6320
.............先让我哭一会.......
因为样例三.... 没敢敲...然后确实是样例错了...然后...上次比赛刚做过的一道类似的题...URAL 1941...大水题啊......悔青了....哭瞎了...比赛不只是智力和实力的比拼啊......aaa...
同样的给你两个字符串.问你第二个是不是第一个字串.所谓字串,这里是说字母个数完全相同两部分就可以了。
#include<stdio.h>
#include<string.h>
#include<iostream>
using namespace std; char str1[], str2[];
int num[], num2[]; int main()
{
int t;
cin >> t;
while(t--)
{
memset(num2, , sizeof(num2));
memset(num, , sizeof(num));
cin >> str1;
int len = strlen(str1);
for (int i=; i<len; ++i)
{
num[i] = str1[i] - 'a';
}
cin >> str2;
int len2 = strlen(str2);
for (int i=; i<len2; ++i)
{
int temp = str2[i] - 'a';
num2[temp]++;
}
int st = ;
bool flag = false;
for (int i=; i<len; ++i)
{
num2[num[i]]--;
while(num2[num[i]] < )
{
num2[num[st]]++;
st++;
}
if (i-st+ == len2)
{
flag = true;
break;
}
}
if (flag)
cout << "YES\n";
else cout << "NO\n";
}
returl ;
}
LOoK
UVALive 6320的更多相关文章
- UVALive - 4108 SKYLINE[线段树]
UVALive - 4108 SKYLINE Time Limit: 3000MS 64bit IO Format: %lld & %llu Submit Status uDebug ...
- UVALive - 3942 Remember the Word[树状数组]
UVALive - 3942 Remember the Word A potentiometer, or potmeter for short, is an electronic device wit ...
- UVALive - 3942 Remember the Word[Trie DP]
UVALive - 3942 Remember the Word Neal is very curious about combinatorial problems, and now here com ...
- 思维 UVALive 3708 Graveyard
题目传送门 /* 题意:本来有n个雕塑,等间距的分布在圆周上,现在多了m个雕塑,问一共要移动多少距离: 思维题:认为一个雕塑不动,视为坐标0,其他点向最近的点移动,四舍五入判断,比例最后乘会10000 ...
- UVALive 6145 Version Controlled IDE(可持久化treap、rope)
题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_ ...
- UVALive 6508 Permutation Graphs
Permutation Graphs Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit ...
- UVALive 6500 Boxes
Boxes Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit Status Pract ...
- UVALive 6948 Jokewithpermutation dfs
题目链接:UVALive 6948 Jokewithpermutation 题意:给一串数字序列,没有空格,拆成从1到N的连续数列. dfs. 可以计算出N的值,也可以直接检验当前数组是否合法. # ...
- 【暑假】[实用数据结构]UVAlive 3135 Argus
UVAlive 3135 Argus Argus Time Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %l ...
随机推荐
- TF-调整矩阵维度 tf.reshape 介绍
函数原型为 def reshape(tensor, shape, name=None) 第1个参数为被调整维度的张量. 第2个参数为要调整为的形状. 返回一个shape形状的新tensor 注意sha ...
- windows下如何获取系统已存在的盘符 【c++】
#include <iostream> #include "classAh.h" #include <atlstr.h> using namespace s ...
- luogu P3387 【模板】缩点
题目 好久没法博客了 这次就水个板子题目吧 tarjan缩点之后重新建图 而且边权应该都是正的(要不我怎么能这么轻松水过去) 在新图上记忆化一下就好了 f[i] 表示 开头选i这个点 的 路径最大值 ...
- JavaScript:值类型 引用类型
JavaScript类型 (1)值类型:数值.布尔值.null.undefined. (2)引用类型:对象.数组.函数. 1.string var str="hongda"; v ...
- 委托的begininvoke
http://blog.csdn.net/cml2030/article/details/2172854 http://blog.163.com/weizhiyong_111/blog/static/ ...
- 抽象类的继承,接口的实现,接口类型数组的使用,根据instanceof判断(返回)是否该是哪一个类型,类型的强转.
总觉得之前第2处有点问题,果然. 还需要instanceof判定一下,然后还需要把数组Animal[]转为Pet的才有方法play()~~~!
- Planar Shadow
Unity上平面阴影的计算与实现 //如何求顶点投影到平面上的点(阴影点) //当平面上取不相等的任意两个点组成一个向量,与平面的法线总是垂直的,向量垂直点乘为0,因此可以通过一个点和一个法线来定义, ...
- 【Android实验】组件通信Intent
实验目的 [TOC] 了解使用Intent进行组件通信原理 掌握使用Intent启动Activity的方法 熟悉和掌握Android组件间通信的方式和技巧 实验要求 设计一个主Activity和一个子 ...
- MVC ---- 如何使用Action委托
先建立一个Serven 类 public class Seven { public static void TestSeven1() { List<User> userList = Fiv ...
- Codeforces Round #303 (Div. 2)E. Paths and Trees 最短路
E. Paths and Trees time limit per test 3 seconds memory limit per test 256 megabytes input standard ...