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 ...
随机推荐
- 20145127《java程序设计》第三周学习总结
教材学习内容总结 第四章 认识对象 4.1 类与对象 0.Java中有基本类型和类类型两个类型系统.本章主要讲的是类类型.java编写几乎都要使用对象,要产生对象必须先定义类.类是对象的设计图,对象是 ...
- hdu1866 A + B forever!(面积并)题解
A + B forever! Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) T ...
- 【附6】hystrix metrics and monitor
一.基本方式 hystrix为每一个commandKey提供了计数器 二.实现流程 https://raw.githubusercontent.com/wiki/Netflix/Hystrix/ima ...
- 【第三章】 springboot + jedisCluster
如果使用的是redis2.x,在项目中使用客户端分片(Shard)机制.(具体使用方式:第九章 企业项目开发--分布式缓存Redis(1) 第十章 企业项目开发--分布式缓存Redis(2)) 如果 ...
- linux——压缩解压命令学习简单笔记
一: 命令名称:gzip 命令英文原意:GNU zip 命令所在路径:/bin/gzip 执行权限:所有用户 语法:gzip 选项 [文件] 功能描述:压缩文件 压缩后文件格式:.gz 1:只能压缩文 ...
- python json 文件读写
import json test_dict = {,,,} print(test_dict) print(type(test_dict))#字典 #dumps 将数据转换成字符串 json_str = ...
- c++ 判断两个容器是否相等(equal)
#include <iostream> // cout #include <algorithm> // equal #include <vector> // vec ...
- Ubuntu16.04 安装 Django
pip2 install django==1.11 或者手动安装: 链接:https://pan.baidu.com/s/1uQJD-pON7gELoCC2TwYnEw 提取码:flgg cd Dja ...
- myEclipse 下配置多个Tomcat
1.进入perfomance 2. 进入server 右键点击configure server connector 3. 切换到 “Arguments” 面板,这里有 一个启动参数,就是修改一下路径 ...
- Asp.net Ajax(ashx)
主要实现 ajax分页功能 效果图 后台方法代码展示 /// <summary> /// WebAjax处理类 /// </summary> public class WebA ...