ZOJ 3430 Detect the Virus】的更多相关文章

题目连接:zoj 3430 Detect the Virus 题目大意:给定一个编码完的串,将每个字符相应着表的数值转换成6位二进制.然后以8为一个数值,又一次形成字符 串,推断给定询问串是否含有字符集中的串. 解题思路:主要是题意,逆编码部分注意.转换完了之后,可能有字符'\0'.所以不能用字符串的形式储存.要用int型 的数组. 注意有同样串的可能. #include <cstdio> #include <cstring> #include <queue> #inc…
传送门: Detect the Virus                                                                                                                                                                                                                                     …
题目链接:https://vjudge.net/problem/ZOJ-3430 Detect the Virus Time Limit: 2 Seconds      Memory Limit: 65536 KB One day, Nobita found that his computer is extremely slow. After several hours' work, he finally found that it was a virus that made his poor…
Detect the Virus Time Limit: 2 Seconds      Memory Limit: 65536 KB One day, Nobita found that his computer is extremely slow. After several hours' work, he finally found that it was a virus that made his poor computer slow and the virus was activated…
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3430 题意:给你n个编码后的模式串,和m个编码后的主串,求原来主串中含有模式串的个数 思路:首先要将模式串解码成未编码前来建立ac自动机,然后解码主串扫描统计即可. code: #include <cstdio> #include <cstring> #include <queue> #include <set> using…
解码的那些事儿,不多说. 注意解码后的结果各种情况都有,用整数数组存储,char数组会超char类型的范围(这个事最蛋疼的啊)建立自动机的时候不能用0来判断结束. #include <cstdio> #include <algorithm> #include <cstring> #include <queue> #include <string> #include <iostream> using namespace std; vec…
题意:问你主串有几种模式串.但是所有串都是加密的,先解码.解码过程为:先把串按照他给的映射表变成6位数二进制数,然后首尾衔接变成二进制长串,再8位8位取变成新的数,不够的补0.因为最多可能到255,所以不能用char存,要用int. 思路:模拟乱搞一下,加个板子完事. 代码: #include<cmath> #include<set> #include<map> #include<queue> #include<cstdio> #include&…
Detect the Virus Time Limit: 2 Seconds      Memory Limit: 65536 KB One day, Nobita found that his computer is extremely slow. After several hours' work, he finally found that it was a virus that made his poor computer slow and the virus was activated…
动态建树MLE.模仿别人的代码模板各种原因wa后,终于AC. #include <iostream> #include <cstdio> #include <cstring> #include <queue> using namespace std; #define MAXN 515*70 #define NXTN 256 ]; ]; unsigned ], src[]; typedef struct { int next[MAXN][NXTN], fail…
One day, Nobita found that his computer is extremely slow. After several hours' work, he finally found that it was a virus that made his poor computer slow and the virus was activated by a misoperation of opening an attachment of an email. Nobita did…