博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
hdu2328 Corporate Identity 扩展KMP
阅读量:7279 次
发布时间:2019-06-30

本文共 1495 字,大约阅读时间需要 4 分钟。

Beside other services, ACM helps companies to clearly state their “corporate identity”, which includes company logo but also other signs, like trademarks. One of such companies is Internet Building Masters (IBM), which has recently asked ACM for a help with their new identity. IBM do not want to change their existing logos and trademarks completely, because their customers are used to the old ones. Therefore, ACM will only change existing trademarks instead of creating new ones.

After several other proposals, it was decided to take all existing trademarks and find the longest common sequence of letters that is contained in all of them. This sequence will be graphically emphasized to form a new logo. Then, the old trademarks may still be used while showing the new identity.
Your task is to find such a sequence.

扩展KMP裸题

 

1 #include
2 #include
3 #include
4 #include
5 #include
6 using namespace std; 7 8 const int maxn=205; 9 int nxt[4005][maxn],ext[4005][maxn];10 char s[4005][maxn];11 int len[4005],ans[maxn];12 13 void EKMP(char s[],char t[],int lens,int lent,int c){14 int i,j,p,l,k;15 nxt[c][0]=lent;j=0;16 while(j+1
cnt)cnt=ext[j][k];60 }61 if(cnt
maxx)maxx=ans[i];64 }65 if(!maxx)printf("IDENTITY LOST\n");66 else{67 string str[205];68 int cnt=0;69 for(int i=0;i
View Code

 

转载于:https://www.cnblogs.com/cenariusxz/p/6592375.html

你可能感兴趣的文章
通过本地文件数据库查询手机归属地
查看>>
uva 10152 ShellSort
查看>>
前端之放大镜
查看>>
民航飞机专业词汇
查看>>
数据类型和变量
查看>>
通过excel快速拼接SQL
查看>>
json数据类型
查看>>
vue-cli的安装使用
查看>>
js实现页面重定向
查看>>
js数组
查看>>
点滴积累【other】---HTTP 错误 404.13 - Not Found,请求筛选模块被配置为拒绝超过请求内容长度的请求(转载)...
查看>>
Simple2D-17(音乐播放器)嵌入 ImGui 库
查看>>
mysql缓存问题
查看>>
基于Heritrix的特定主题的网络爬虫配置与实现
查看>>
volcanol_Linux_问题汇总贴
查看>>
maven的配置文件setting
查看>>
每天进步:2014年11月几篇
查看>>
bzoj2055: 80人环游世界(可行流)
查看>>
运维-安装rabbitmq 集群
查看>>
Ubuntu安装Oh My Zsh
查看>>