当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
力扣第 305 场周赛复盘
Singleton DCL (double check the lock) full han mode and the hungry
我入职阿里后,才知道原来简历这么写
神经网络优化器
2019南昌网络赛 C题,Hello 2019
Distributed id generator implementation
常用测试用例设计方法之正交实验法详解
2022 年全球十大最佳自动化测试工具
重要消息丨.NET Core 3.1 将于今年12月13日结束支持
C语言的内置宏(定义日志宏)
MongDb query method
买口罩(0-1背包)
Tkinter可以选择的颜色
Mysql实操
【报错】Root Cause com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
db.sqlite3 has no "as Data Source" workaround
详解C语言中的wait()函数和waitpid()函数
The Integer thread safe
The singleton pattern
Codeforces Round #359 (Div. 2) C. Robbers' watch 暴力枚举