当前位置:网站首页>poj3461 Oulipo【KMP】
poj3461 Oulipo【KMP】
2022-07-27 14:12:00 【51CTO】
Topic link :
http://poj.org/problem?id=3461
The main idea of the topic :
Give a string T, To express an article , Give me another string W, Means the word .T and W All contain only 26 Capital letters .
Now calculate words W In the article T Is the number of times .W stay T The number of occurrences in must match continuously , No two matches are possible
There are overlapping parts .
Ideas :
First find the string W Of Next[] The pointer , And then match , When a match is successful , Keep going back to Next[j] Go backwards
matching , Until the string T At the end of . here , The number of successful matches obtained is the desired , namely W stay T Is the number of times .
AC Code :
边栏推荐
- Unity2d -- camera follow
- Is it still time to take the PMP Exam in September?
- Cultural tourism and data collection | travel to Yunnan in an artistic way
- uniapp的request数据请求简单封装步骤
- Carla notes (04) - client and world (create client, connect world, batch object, set weather, set lights, world snapshots)
- [x for x in list_a if not np.isnan(x)]和[x if not np.isnan(x) else None for x in list_a]的区别
- Negative ring
- The difference between [x for X in list_a if not np.isnan (x)] and [x if not np.isnan (x) else none for X in list_a]
- Flat die cutting machine
- Lighting 5g in the lighthouse factory, Ningde era is the first to explore the way made in China
猜你喜欢

10 practical uses of NFT

13、用户web层服务(一)

Vscode -- create template file

Chapter3 data analysis of the U.S. general election gold offering project

UTNet 用于医学图像分割的混合Transformer

WPF visifire.charts4.6.1 tutorial with source code

Flat die cutting machine

Cultural tourism and data collection | travel to Yunnan in an artistic way

A Keypoint-based Global Association Network for Lane Detection

Some key information about Max animation (shift+v)
随机推荐
spark job 使用log4j appender 追加日志到本地文件或者mysql
Design of LR1 compiler based on C language
纯c手写线程池
Interview eight part essay · TCP protocol
Converter registration of easyexcel
【idea】设置提取serialVersionUID
Wechat campus laundry applet graduation design finished product of applet completion work (3) background function
基于在线问诊记录的抑郁症病患群组划分与特征分析
How to make computers have public IP
「游戏引擎 浅入浅出」4.1 Unity Shader和OpenGL Shader
[training day4] card game [greed]
阿里最新股权曝光:软银持股23.9% 蔡崇信持股1.4%
[related contents of multithreading]
Recursive method to realize the greatest common divisor
Realize the basic operations such as the establishment, insertion, deletion and search of linear tables based on C language
基于RoBERTa-wwm动态融合模型的中文电子病历命名实体识别
GoPro接入 - 根据GoPro官方文档/Demo,实现对GoPro的控制和预览
[training day3] section [greed] [two points]
There is no need for semantic segmentation of annotation data! Eth & Leuven University proposed maskdistill, using transformer for unsupervised semantic segmentation, SOTA
Good architecture is evolved, not designed