SPOJ REPEATS Repeats

该博客介绍了一个字符串问题,要求找到输入长字符串u中,由字符'a'和'b'组成的最长(k,l)-重复子串,即由一个长度为l的种子字符串t重复k次形成的子串,并要求k尽可能大。例如,字符串u=babbabaabaabaabab包含了一个(4,3)-重复子串's',起始于位置5。程序需输出最大重复次数k。" 121408949,7800548,R语言WVPlots包绘制克利夫兰点图,"['数据可视化', 'R语言', '数据分析']
摘要由CSDN通过智能技术生成

Description

A string s is called an (k,l)-repeat if s is obtained by concatenating k>=1 times some seed string t with length l>=1. For example, the string

s = abaabaabaaba

is a (4,3)-repeat with t = aba as its seed string. That is, the seed string t is 3 characters long, and the whole string s is obtained by repeating t 4 times.

Write a program for the following task: Your program is given a long string u consisting of characters ‘a’ and/or ‘b’ as input. Your program must find some (k,l)-repeat that occurs as substring within u with k as large as possible. For example, the input string

u = babbabaabaabaabab

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值