题目地址:https://leetcode.com/problems/longest-valid-parentheses/Given a string containing just the characters ‘(’ and ‘)’, find the length of the longest valid (well-formed) parentheses substring.
For “(...
分类:
其他好文 时间:
2015-03-14 16:55:18
阅读次数:
188
求树的最长链,BFS和DFS都可以,时间复杂度O(n)#include#includeint tot,vt[20005],nxt[20005],a[20005];bool vis[10005];int n,i,j,xx,yy,s,ma,r;void search(int x,int dep){ .....
分类:
其他好文 时间:
2015-03-14 10:58:28
阅读次数:
207
frac1解题报告—— icedream61 博客园(转载请注明出处)--------------------------------------------------------------------------------------------------------------...
分类:
其他好文 时间:
2015-03-14 10:50:16
阅读次数:
124
广播的概念
案例-监听短信到来并解析短信内容
案例-拦截外拨电话并设置区号
案例-SD卡状态监听
介绍一些常用的广播
发送自定义广播
有序广播和无序广播
启程!!!广播的概念
广播的种类:
无序广播(Normal broadcasts),类似于日常使用的WIFI,由一个广播者发出信号,可以有很多接收者同时接收,并且信号无法被中断和篡改;有序广播(Ordered broadcasts),可以有最终的接...
分类:
移动开发 时间:
2015-03-14 01:03:03
阅读次数:
274
题目:给你一个小写字母组成大的串和一个整数n,找到里面长度为n出现最频繁的子串。
分析:字符串、hash表、字典树。这里使用hash函数求解,只做一次扫描即可。
说明:如果频率相同输出字典序最小的。
#include
#include
#include
#include
char subs[15],buf[1000001];
char *strsub(char *str, int ...
分类:
其他好文 时间:
2015-03-13 18:46:34
阅读次数:
151
[LeetCode] 032. Longest Valid Parentheses (Hard) (C++)...
分类:
编程语言 时间:
2015-03-13 16:35:05
阅读次数:
170
LeetCode_Longest Consecutive Sequence...
分类:
其他好文 时间:
2015-03-13 07:09:33
阅读次数:
172
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 the farthest le...
分类:
其他好文 时间:
2015-03-13 00:14:25
阅读次数:
141
题目要求:Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4, 200, 1, 3, 2],The lon...
分类:
其他好文 时间:
2015-03-11 23:17:44
阅读次数:
155
Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa...
分类:
其他好文 时间:
2015-03-11 21:29:40
阅读次数:
112