这是最大上升子序列的变形,可并没有LIS那么简单。需要用到二分查找来优化。看了别人的代码,给人一种虽不明但觉厉的赶脚直接复制粘贴了,嘿嘿原文链接:http://blog.csdn.net/ice_crazy/article/details/7536332假设存在一个序列d[1..9] = 2 1 5...
分类:
其他好文 时间:
2014-07-23 12:04:56
阅读次数:
276
--------------------------------------第一种:利用动软代码生成器生成的分页------------------------------------//新建一个一般处理程序 pageIndex = int.Parse(HttpContext....
分类:
其他好文 时间:
2014-07-23 12:04:46
阅读次数:
534
Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two nu...
分类:
其他好文 时间:
2014-07-23 12:03:26
阅读次数:
287
一键重置mysql的root密码的实现脚本。@echo offtitle mysql::从注册表找到Mysql的安装路径写入文件mysql.txt reg query HKLM\SYSTEM\ControlSet001\Services\MySQL | find /I "ImagePath">C:\...
分类:
数据库 时间:
2014-07-23 12:03:16
阅读次数:
280
MySQL中创建用户与授权的实现方法。运行环境:widnows xp professional + MySQL5.0一, 创建用户:命令:CREATE USER 'username'@'host' IDENTIFIED BY 'password';说明:username - 你将创建的用户名, ho...
分类:
数据库 时间:
2014-07-23 12:03:06
阅读次数:
306
状态转移方程可以直接用dp[i][j]=max(dp[i+1,j]+a[i],dp[i,j-1]+a[j])*(2^k)),但是还要算2^k次方,可以先用数组储存2的方幂,但不可避免高精度乘法,如果只是*2的话可以用加法代替逆向思考,自内而外,用f[i,j]表示从i取到j的最大值,状态转移方程便为f...
分类:
其他好文 时间:
2014-07-23 12:02:56
阅读次数:
234
题目:Given a linked list, return the node where the cycle begins. If there is no cycle, return null.Follow up:Can you solve it without using extra spac....
分类:
编程语言 时间:
2014-07-23 12:02:46
阅读次数:
304
题目:Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?题解:这道题连带着II是很经典的,在看CC150时候,纠结这个问题纠结了很久....
分类:
编程语言 时间:
2014-07-23 12:02:26
阅读次数:
311
2 solutions: bin-search and Newton iteration.class Solution {public: int _sqrt(long long tgt, long long i0, long long i1) { long long can...
分类:
其他好文 时间:
2014-07-23 12:02:06
阅读次数:
236
Another textbook problem. We take back of postorder array as the current root, and then we can split the inorder array: 1st half for current right chi...
分类:
其他好文 时间:
2014-07-23 12:01:56
阅读次数:
210