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

因为样例三.... 没敢敲...然后确实是样例错了...然后...上次比赛刚做过的一道类似的题...URAL 1941...大水题啊......悔青了....哭瞎了...比赛不只是智力和实力的比拼啊......aaa...

同样的给你两个字符串.问你第二个是不是第一个字串.所谓字串,这里是说字母个数完全相同两部分就可以了。

  1. #include<stdio.h>
  2. #include<string.h>
  3. #include<iostream>
  4. using namespace std;
  5.  
  6. char str1[], str2[];
  7. int num[], num2[];
  8.  
  9. int main()
  10. {
  11. int t;
  12. cin >> t;
  13. while(t--)
  14. {
  15. memset(num2, , sizeof(num2));
  16. memset(num, , sizeof(num));
  17. cin >> str1;
  18. int len = strlen(str1);
  19. for (int i=; i<len; ++i)
  20. {
  21. num[i] = str1[i] - 'a';
  22. }
  23. cin >> str2;
  24. int len2 = strlen(str2);
  25. for (int i=; i<len2; ++i)
  26. {
  27. int temp = str2[i] - 'a';
  28. num2[temp]++;
  29. }
  30. int st = ;
  31. bool flag = false;
  32. for (int i=; i<len; ++i)
  33. {
  34. num2[num[i]]--;
  35. while(num2[num[i]] < )
  36. {
  37. num2[num[st]]++;
  38. st++;
  39. }
  40. if (i-st+ == len2)
  41. {
  42. flag = true;
  43. break;
  44. }
  45. }
  46. if (flag)
  47. cout << "YES\n";
  48. else cout << "NO\n";
  49. }
  50. returl ;
  51. }

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. 20145127《java程序设计》第三周学习总结

    教材学习内容总结 第四章 认识对象 4.1 类与对象 0.Java中有基本类型和类类型两个类型系统.本章主要讲的是类类型.java编写几乎都要使用对象,要产生对象必须先定义类.类是对象的设计图,对象是 ...

  2. hdu1866 A + B forever!(面积并)题解

    A + B forever! Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) T ...

  3. 【附6】hystrix metrics and monitor

    一.基本方式 hystrix为每一个commandKey提供了计数器 二.实现流程 https://raw.githubusercontent.com/wiki/Netflix/Hystrix/ima ...

  4. 【第三章】 springboot + jedisCluster

    如果使用的是redis2.x,在项目中使用客户端分片(Shard)机制.(具体使用方式:第九章 企业项目开发--分布式缓存Redis(1)  第十章 企业项目开发--分布式缓存Redis(2)) 如果 ...

  5. linux——压缩解压命令学习简单笔记

    一: 命令名称:gzip 命令英文原意:GNU zip 命令所在路径:/bin/gzip 执行权限:所有用户 语法:gzip 选项 [文件] 功能描述:压缩文件 压缩后文件格式:.gz 1:只能压缩文 ...

  6. python json 文件读写

    import json test_dict = {,,,} print(test_dict) print(type(test_dict))#字典 #dumps 将数据转换成字符串 json_str = ...

  7. c++ 判断两个容器是否相等(equal)

    #include <iostream> // cout #include <algorithm> // equal #include <vector> // vec ...

  8. Ubuntu16.04 安装 Django

    pip2 install django==1.11 或者手动安装: 链接:https://pan.baidu.com/s/1uQJD-pON7gELoCC2TwYnEw 提取码:flgg cd Dja ...

  9. myEclipse 下配置多个Tomcat

    1.进入perfomance 2. 进入server  右键点击configure server connector 3. 切换到 “Arguments” 面板,这里有 一个启动参数,就是修改一下路径 ...

  10. Asp.net Ajax(ashx)

    主要实现 ajax分页功能 效果图 后台方法代码展示 /// <summary> /// WebAjax处理类 /// </summary> public class WebA ...