Encrypted Password UVALive
来源:互联网 发布:乐高蝙蝠侠大电影知乎 编辑:程序博客网 时间:2024/06/10 06:19
题目链接:
Encrypted Password
UVALive - 6320
tho: n 方会超时, 所以就转换成 n*26 的算法
#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>#include <queue>#define inf 0x3f3f3f#define ms(x) memset(x,0,sizeof(x))using namespace std;int main(){ int T; char s[100123]; char t[100123]; int book[30]; int vis[30]; while(cin>>T) { while(T--) { ms(book); ms(vis); scanf("%s",s); scanf("%s",t); int ls = strlen(s); int lt = strlen(t); for(int i=0;i<lt;i++) { vis[s[i]-'a']++; //生成串 book[t[i]-'a']++; //原串 } int f; for(int i=0;i+lt<=ls;i++) { f=1; for(int j=0;j<27;j++) { if(book[j]!=vis[j]) { f=0;break; } } vis[s[i]-'a']--; vis[s[i+lt]-'a']++; if(f) break; } if(f) printf("YES\n"); else printf("NO\n"); } } return 0;}
阅读全文
0 0
- Encrypted Password UVALive
- 【思维-桶记录数组动态滚动】Encrypted Password UVALive
- Using Encrypted DataSource Password in JBoss AS7
- UVALive 2755 Hidden Password(字符串最小表示)
- UVALive 2755 Hidden Password (最小表示法)
- UVALive 4126 Password Suspects (AC自动机+DP)
- Weblogic 10g: How to get AES encrypted password using WLS cmd
- UVALive 4126 Password Suspects(AC自动机 + DP)
- UVaLive 4126 - Password Suspects (AC自动机 DP)
- UVALive 2775 (LA 2775) Hidden Password 后缀数组
- UVALive 4126 Password Suspects(AC自动机+dp)
- UVALive 4126 Password Suspects(AC自动机 套 DP)
- UVALive 6456Zhuge Liang's Password (water~~)
- UVALive
- UVALive
- UVALive
- UVALive
- UVALive
- Cognos报表调度与作业管理
- idea 配置memcahced mvnrepository
- VirtualBox 如何安装win10系统
- JS笔记(2) —— JS 字符串操作API
- 线程的实现方式
- Encrypted Password UVALive
- 使用CSDN-markdown编辑器
- 配置Groovy开发环境(Windows)
- jstack命令详解
- 根据request获取客户端的IP
- Jackson格式化时间
- 低版本ACCESS在VS中打不开
- 使用Intellij idea 来创建一个购物网站——易买网
- spring中存oracle的clob类型数据