题意:
给一个字符串,然后找一个子串,使子串满足其中连续重复子串最多。
比如ababab,重复次数为3,ababa,重复次数为1(abab是两次)
恶心在于还要输出最小字典序。
题解网上都有,不发了。
代码:
#include
#include
#include
#include
#define N 101000
#define LOGN 20
#define...
分类:
编程语言 时间:
2015-01-13 15:58:20
阅读次数:
256
https://oj.leetcode.com/problems/maximum-depth-of-binary-tree/Given a binary tree, find its maximum depth.The maximum depth is the number of nodes alo...
分类:
其他好文 时间:
2015-01-13 14:13:55
阅读次数:
105
Given an unsorted array, find the maximum difference between the successive elements in its sorted form.
Try to solve it in linear time/space.
Return 0 if the array contains less than 2 elements.
Y...
分类:
编程语言 时间:
2015-01-12 22:34:27
阅读次数:
274
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.
For example, given the array [?2,1,?3,4,?1,2,1,?5,4],
the contiguous subarray [4,?1,2,1] ha...
分类:
其他好文 时间:
2015-01-12 13:07:22
阅读次数:
149
Easy Task
Time Limit: 2 Seconds Memory Limit: 65536 KB
You are given n integers. Your task is very easy. You should find the maximum integer a and the minimum integer b among these n inte...
分类:
其他好文 时间:
2015-01-11 20:24:46
阅读次数:
242
Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array[2,3,-2,4],the...
分类:
其他好文 时间:
2015-01-11 12:11:44
阅读次数:
133
The problem 1:Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to t...
分类:
其他好文 时间:
2015-01-11 06:07:49
阅读次数:
216
The problem:Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree,...
分类:
其他好文 时间:
2015-01-11 00:59:13
阅读次数:
287
虽然是两个水题,但是一次AC的感觉真心不错这个问题算是maximum-subarray问题的升级版,不过主要算法思想不变:1. maximum-subarray问题maximum-subarray就是找到数组A[1....n]中的连续子数组A[i.....j]并且A[i]+...+A[j]和最大。当...
分类:
其他好文 时间:
2015-01-10 16:32:04
阅读次数:
135