题目如下:
Tree
You are to determine the value of the leaf node in a given binary treethat is the terminal node of a path of least value from the root of thebinary tree to any le...
分类:
其他好文 时间:
2014-06-05 05:27:11
阅读次数:
268
题目:
链接:点击打开链接
题意:
中文题
算法:
思路:
赤裸裸的最小生成树。。
代码:
#include
#include
using namespace std;
struct node{
int u,v,w;
} e[110];
int p[110];
int n,m,sum,ans;
int cmp(node...
分类:
其他好文 时间:
2014-06-05 03:50:23
阅读次数:
232
今天做作业连了一天的mysql。
最后我痛定思痛,决定从0开始学习jsp,省的又面临不会的局面。
忙活了一晚上,终于把数据库连接上了,不过,好伤心啊,我连个数据库都这么墨迹。。。
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServer...
分类:
数据库 时间:
2014-06-05 03:37:23
阅读次数:
244
解析程序自己的附加数据,将附加数据写入文件中。
主要是解析PE文件头,定位到overlay的地方,写入文件。常应用的场景是在crackme中,crackme自身有一段加密过的附加数据,在crackme运行的过程中解析自己的附加数据,然后解密这段数据。。。。
代码留存:
//解析自己的PE文件
TCHAR szModuleFile[MAX_PATH] = {0};
::GetMod...
分类:
其他好文 时间:
2014-06-05 03:01:16
阅读次数:
438
在工作中的经常使用repo命令,但是有时会忘记一些命令和遇到的一些问题,记录下来方便已经查询。
问题1:找不到命令:repo
方法:
在下载android源码的时候用repo时提示找不到命令,可以用如下方法解决,在命令行中输入如下两行:
echo 'export PATH=$PATH:$Home/bin' >>~/.bashrc
export PATH=$PATH...
分类:
移动开发 时间:
2014-06-05 02:39:47
阅读次数:
265
Description Resource
Path Location
Type
cvc-complex-type.2.4.a: Invalid content was found starting with element 'init-param'. One of '{"http://java.sun.com/xml/ns/javaee":enabled, "http://java.sun....
分类:
Web程序 时间:
2014-06-03 05:31:38
阅读次数:
514
最大连续子序列(HDU1003,1231)
最大递增子序列和,sum[i]=max(sum[j])+a[i],j
最长公共子序列,LCS经典算法(HDU1159)。
题解:
实际上,我没看出hdu1003和1231的本质差别,形式上的差别就是记载的东西不一样,一个是记载下标,一个是记载元素。基本就是那么回事吧。很多算法书在讨论时效都会拿这个例子来说明,让大家看到算法的力量,从一个弱渣算法到...
分类:
其他好文 时间:
2014-06-03 04:19:10
阅读次数:
279
select p.id comperitorId,p.compcorp competitorName,
sum(case when c.kindname = 'ATM' then c.num else 0 end) atm,
sum(case when c.kindname = 'CRS' then c.num else 0 end) crs,
sum(case when c.kindname...
分类:
数据库 时间:
2014-06-03 03:12:09
阅读次数:
211
1、Maximum Depth of Binary Tree
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 leaf node.
clas...
分类:
其他好文 时间:
2014-06-02 23:13:22
阅读次数:
290
记录3个变量。
sum[i]:当前区间被覆盖2次及两次以上的面积。
num[i]:当前区间被覆盖1次及一次以上的面积。
cover[i]:覆盖的lazy标记。
对于每一个区间.
更新操作如下:
void push_up(int_now)
{
if(cover[rt]==0)
{
num[rt]=num[rt<<1]+num[rt<<1|1];
...
分类:
其他好文 时间:
2014-05-31 17:58:57
阅读次数:
296