链剖即可。其实就是利用了链剖后子树都在一段连续的区间内所以可以做到O(logn)查询和修改。 线段树细节打错了。。要专心!肉眼差错都能找出一堆出来显然是不行的!。 1199 Money out of Thin Air 题目来源: Ural 基准时间限制:1 秒 空间限制:131072 KB 分值: ...
分类:
其他好文 时间:
2016-09-15 14:53:28
阅读次数:
200
You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you cl ...
分类:
其他好文 时间:
2016-09-15 13:48:26
阅读次数:
116
http://www.jb51.net/article/51749.htm http://blog.csdn.net/drifterj/article/details/7848809 ...
分类:
其他好文 时间:
2016-09-15 13:46:47
阅读次数:
163
题目描述 给出一棵二叉树的中序与后序排列。求出它的先序排列。(约定树结点用不同的大写字母表示,长度<=8)。 输入输出格式 输入格式: 2行,均为大写字母组成的字符串,表示一棵二叉树的中序与后序排列。 输出格式: 1行,表示一棵二叉树的先序。 输入输出样例 输入样例#1: BADC BDCA 输出样 ...
分类:
其他好文 时间:
2016-09-15 13:47:36
阅读次数:
177
类CRect是对Windows结构RECT的封装,凡是能用RECT结构的地方都可以用CRect代替。 结构RECT表示一个矩形的位置和尺寸,其定义为: typedef struct tagRECT{ LONG left; LONG top; LONG right; LONG bottom; } RE ...
分类:
其他好文 时间:
2016-09-15 13:46:01
阅读次数:
197
前段时间在研究过用CSS来实现画出一个箭头,效果如下: 实际上它是由下面两部分旋转一定角度后得到的。 我今天要讲的红色的这一部分,也就是箭头的尾巴。 1.水平半径和垂直半径 平时我们想要圆角的时候,直接设置的border-radius,像下面这样: border-radius: 10px; 我们将b... ...
分类:
其他好文 时间:
2016-09-15 13:46:22
阅读次数:
332
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. ...
分类:
其他好文 时间:
2016-09-15 13:43:33
阅读次数:
131
EqualsBuilder和HashCodeBuilder 自动化hashCode()和equals() 问题产生:当需要自动实现hashCode()和equals()方法 解决方法:使用EqualsBuilder和HashCodeBuilder 使用举例: import org.apache.co ...
分类:
其他好文 时间:
2016-09-15 13:44:11
阅读次数:
366
Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple ...
分类:
其他好文 时间:
2016-09-15 13:44:57
阅读次数:
137
“非常男女”计划 plan 【题目描述】: Matrix67已经当过多次“媒人”了。他因此获得了许多经验。例如,距Matrix67观察,身高相近的人似乎比较合得来。 Matrix67在学校策划了一次大型的“非常男女”配对活动。对于这次活动的参与者,Matrix67有自己独特的选择方式。他希望能选择男 ...
分类:
其他好文 时间:
2016-09-15 13:43:07
阅读次数:
401
一、 Sass (安装时从C盘开始不可有中文) 1、文件后缀名有两种,sass中不包含{}和;, scss中包含{}和;,建议使用scss的后缀名。 2、用@import导入文件,可引入scss或者css文件,区别在于scss文件会被译, css文件则不会。 3、变量 $变量名(自取):值,如果在值 ...
分类:
其他好文 时间:
2016-09-15 13:42:57
阅读次数:
148
Given an encoded string, return it's decoded string. The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is b ...
分类:
其他好文 时间:
2016-09-15 13:43:53
阅读次数:
321
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping yo ...
分类:
其他好文 时间:
2016-09-15 13:42:14
阅读次数:
136
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, ...
分类:
其他好文 时间:
2016-09-15 13:40:32
阅读次数:
120