
字符串相关
怎呼虹
你只负责精彩,命运自有安排。
展开
-
HDU 2896 病毒入侵 AC自动机 多模式串匹配
传送门:HDU 2896多模式串匹配的模版题,无脑点的话可以采用AC自动机模版解决,简单明了,详见代码。#include <stdio.h> #include <string.h> #include <iostream> #include <algorithm> #include <queue> using namespace std;const int nodesize = 210*500; //原创 2016-12-10 13:24:03 · 326 阅读 · 0 评论 -
POJ 1035 Spell checker 字符串容错检查
传送门:POJ 1035 Spell checker分析 : 按照题目的意思,检查字符串是否符合要求。 每个要求对应一个函数,注意:插入是删除的逆过程,不用重复写函数。 这样逻辑清晰,简单易懂。代码如下:#include <stdio.h> #include <string.h>// 删除 bool del(char s1[], char s2[]){ int i,j; boo原创 2017-01-06 17:02:06 · 574 阅读 · 0 评论 -
POJ 1936 All in All 字符串匹配
传送门:POJ 1936 All in All分析: 简单的字符串匹配。 前者是后者的子序列,就输出Yes,否则输出No。 比较水,不过写法有点技巧。代码如下:#include <iostream> #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> using namespace std; #d原创 2017-01-08 13:25:10 · 610 阅读 · 0 评论 -
POJ 3080 Blue Jeans 字符串函数应用
传送门:POJ 3080 Blue Jeans分析: 利用strstr()函数,方便很多。代码如下:// 数据量不大,可以暴力枚举 // 坑:如果同时有等长的子序列,则输出字典序列最小的! #include <stdio.h> #include <string.h> int main() { int i,j,k,cas,n,z,h,cnt,flag,ii,total; char s原创 2017-01-15 21:50:30 · 374 阅读 · 0 评论