.............先让我哭一会.......

因为样例三.... 没敢敲...然后确实是样例错了...然后...上次比赛刚做过的一道类似的题...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的更多相关文章

  1. UVALive - 4108 SKYLINE[线段树]

    UVALive - 4108 SKYLINE Time Limit: 3000MS     64bit IO Format: %lld & %llu Submit Status uDebug ...

  2. UVALive - 3942 Remember the Word[树状数组]

    UVALive - 3942 Remember the Word A potentiometer, or potmeter for short, is an electronic device wit ...

  3. UVALive - 3942 Remember the Word[Trie DP]

    UVALive - 3942 Remember the Word Neal is very curious about combinatorial problems, and now here com ...

  4. 思维 UVALive 3708 Graveyard

    题目传送门 /* 题意:本来有n个雕塑,等间距的分布在圆周上,现在多了m个雕塑,问一共要移动多少距离: 思维题:认为一个雕塑不动,视为坐标0,其他点向最近的点移动,四舍五入判断,比例最后乘会10000 ...

  5. UVALive 6145 Version Controlled IDE(可持久化treap、rope)

    题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_ ...

  6. UVALive 6508 Permutation Graphs

    Permutation Graphs Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu Submit ...

  7. UVALive 6500 Boxes

    Boxes Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu Submit Status Pract ...

  8. UVALive 6948 Jokewithpermutation dfs

    题目链接:UVALive 6948  Jokewithpermutation 题意:给一串数字序列,没有空格,拆成从1到N的连续数列. dfs. 可以计算出N的值,也可以直接检验当前数组是否合法. # ...

  9. 【暑假】[实用数据结构]UVAlive 3135 Argus

    UVAlive 3135 Argus Argus Time Limit: 3000MS   Memory Limit: Unknown   64bit IO Format: %lld & %l ...

随机推荐

  1. 完整的Android开发环境Eclipse+ADT+SDK(22.0.1)

    现在开始学习Android嵌入式编程,首要的问题就是在Windows中搭建开发环境,就这个都要摸索很长的时间,总是在版本之间折腾折腾去,而且Google的Android正式差劲得很,经常是连不上,要不 ...

  2. C++快速输入输出优化

    在这里存一下我的快速输入输出优化 以及写题模板 这里的是$getchar$优化和$putchar$优化,$fread$和$fwrite$暂时咕咕咕 快速输入 这里$define$了一个$I\_int$ ...

  3. 每个成长者,必须学会可以练习 (来自ProcessOn流程图工具作者底部)

  4. Win7上安装WMware虚拟机和Ubuntu操作系统

    效果图: 问题拾遗: 一.如何划分一个新硬盘空间? 参考链接:如何新建磁盘空间 效果图: 我划分了20G的内存空间给Ubuntu的硬盘空间.一般来说15G就够用了. 二.VMware上拷贝Ubuntu ...

  5. [异常记录-12]Web Deploy部署:未能连接到远程计算机,请确保在远程计算机上安装了 Web Deploy 并启动了所需的进程("Web Management Service")

    Web Deploy 安装 请参考:图文详解远程部署ASP.NET MVC 5项目 如此安装后还不行,  可以在卸载后重新安装 Web Deploy 时,不要选那个经典还是典型的安装选项,选自定义安装 ...

  6. python 字符串转变量方法

    1.response=eval('requests.'+func.lower())(destURL, headers=requestHeaders, data=postData, params=que ...

  7. Java 面向对象之static,final,匿名对象,内部类,包,修饰符

    01final关键字概念 A: 概述 继承的出现提高了代码的复用性,并方便开发.但随之也有问题,有些类在描述完之后,不想被继承, 或者有些类中的部分方法功能是固定的,不想让子类重写.可是当子类继承了这 ...

  8. SQLServer创建用户、数据库、表、约束、存储过程、视图

    --创建登录账户和数据库用户 ' exec sp_grantdbaccess 'sysAdmin','aa' --给数据库用户赋权限 grant select,update,insert,delete ...

  9. python通过get方式,post方式发送http请求和接收http响应-urllib urllib2

    python通过get方式,post方式发送http请求和接收http响应-- import urllib模块,urllib2模块, httplib模块 http://blog.163.com/xyc ...

  10. mount: unknown filesystem type 'LVM2_member'解决方案【转】

    一台服务器,普通/dev/sda1/2(硬盘一) 同步数据到 lvm_member(硬盘二) rsync两硬盘数据同步: From: http://hi.baidu.com/williwill/ite ...