当前位置:网站首页>MUV LUV EXTRA 2019CCPC Qinhuangdao Station J Question KMP
MUV LUV EXTRA 2019CCPC Qinhuangdao Station J Question KMP
2022-08-09 07:04:00 【swust_fang】
topic link
The meaning of the question: It means to count a string for you two, and then let you process the string after the decimal point of the string, find a loop section and the length of the corresponding occurrence,
Then use a*p-b*l to get a maximum value
Then the loop section must be thought of KMP, and then the loop length According to the example, he can find a loop section from the middle, but it all loops to the end,
Then I found out that he was actually looking for a loop section from the back to the front, then this question is very simple
Find the string and reverse it, find KMP, enumerate the length from front to back, the next array corresponds to the length of the loop section, and traverse it once to find the maximum value
Pit: The character of 1e7 came out, and I wrote cin, which was unexpectedly t (t1 sent
The initial value of ans should be assigned as infinitesimal~(wa1 hair!
ac code:
//#pragma comment (linker, "/STACK:102400000,102400000")//#include#include#include#include#include#include#include#include#include#include#include
边栏推荐
- Service
- Simple to use Lambda expressions
- SSL证书最长有效期13个月,还有必要一次申请多年吗?
- 2022 年全球十大最佳自动化测试工具
- 错误:为 repo ‘oracle_linux_repo‘ 下载元数据失败 : Cannot download repomd.xml: Cannot download repodata/repomd.
- shardingsphere data sharding configuration item description and example
- 2017icpc沈阳 G Infinite Fraction Path BFS+剪枝
- 集合内之部原理总结
- 神经网络优化器
- 详解C语言中的wait()函数和waitpid()函数
猜你喜欢
随机推荐
力扣第 305 场周赛复盘
Zero shift of leetcode
Transaction concluded
图论,二叉树,dfs,bfs,dp,最短路专题
Singleton DCL (double check the lock) full han mode and the hungry
AD picture PCB tutorial 20 minutes clear label shop operation process, copper network
细谈VR全景:数字营销时代的宠儿
Use baidu EasyDL intelligent bin
Thread Pool Summary
查看日志常用命令
常见的分布式事务解决方案
Rsync常见错误
sklearn数据预处理
分布式理论
ByteDance Written Exam 2020 (Douyin E-commerce)
mysql summary
用tensorflow.keras模块化搭建神经网络模型
6 states of a thread
排序第四节——归并排序(附有自己的视频讲解)
无重复的字符的最长子串