实验现象:在控制台打印按键值,并且通过按键控制相应的LED亮灭。 1.代码 input_subsys_drv.c input_subsys_test.c makefile 2. 实验 2.1 安装驱动程序: insmod input_subsys_drv.ko 运行应用程序 ./input_subs ...
分类:
系统相关 时间:
2016-10-03 06:58:48
阅读次数:
266
写了一个爆搜,超时了,所以更改了一个方法,使用flag数组记录标志, 动态规划,类似于lcs的解法,数组flag[i][j]记录s从i到j是不是回文 首先初始化,i>=j时,flag[i][j]=true,这是因为s[i][i]是单字符的回文,当i>j时,为true,是因为有可能出现flag[2][ ...
分类:
其他好文 时间:
2016-10-02 19:36:57
阅读次数:
146
3.LongestSubstringWithoutRepeatingCharactersGivenastring,findthelengthofthelongestsubstringwithoutrepeatingcharacters.Examples:Given"abcabcbb",theansweris"abc",whichthelengthis3.Given"bbbbb",theansweris"b",withthelengthof1.Given"pwwkew",theansweris"wke",wit..
分类:
其他好文 时间:
2016-10-02 07:07:09
阅读次数:
120
Write a function to find the longest common prefix string amongst an array of strings. ...
分类:
其他好文 时间:
2016-10-02 00:10:17
阅读次数:
156
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longes ...
分类:
其他好文 时间:
2016-10-01 12:30:06
阅读次数:
100
32.LongestValidParenthesesGivenastringcontainingjustthecharacters‘(‘and‘)‘,findthelengthofthelongestvalid(well-formed)parenthesessubstring.For"(()",thelongestvalidparenthesessubstringis"()",whichhaslength=2.Anotherexampleis")()())",wherethelongestvalidparen..
分类:
其他好文 时间:
2016-10-01 06:18:28
阅读次数:
108
题目如下: Sample Input #0 Sample Output #0 The longest possible subset of characters that is possible by deleting zero or more characters from HARRY andSA ...
分类:
其他好文 时间:
2016-09-30 01:41:59
阅读次数:
113
暴力。 虽然$a[i]$最大有${10^9}$,但是$m$最大只有${10^6}$,因此可以考虑暴力。 记$cnt[i]$表示数字$i$有$cnt[i]$个,记$p[i]$表示以$i$为倍数的情况下,最多能选出多少个数字。 $p[i]$可以暴力计算出来,最后就是找到$p[i]$最大的$i$,然后输出 ...
分类:
其他好文 时间:
2016-09-28 22:34:09
阅读次数:
146