Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.
For example,
Given [0,1,0,2,1,0,1,3,2,1,2,1]...
分类:
移动开发 时间:
2014-09-13 21:34:25
阅读次数:
219
本文实现了samba服务被访问的时候通过windows域服务器进行用户名和密码验证;认证通过的用户可以自动分配500M的共享空间;在用户通过windows域登陆系统的时候可以自动把这块空间映射成一块硬盘。环境说明:文件服务器用的Centos5.3,域控用的Win2k3 sp2,Domain是rain...
分类:
其他好文 时间:
2014-09-10 22:22:21
阅读次数:
551
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining....
分类:
移动开发 时间:
2014-09-01 21:01:33
阅读次数:
220
本文为senlie原创,转载请保留此地址:http://blog.csdn.net/zhengsenlie
Trapping Rain Water
Total Accepted: 14568 Total
Submissions: 50810My Submissions
Given n non-negative integers representin...
分类:
移动开发 时间:
2014-08-29 01:24:36
阅读次数:
238
题目大意:
有一些屋顶,相当于一些线段(不想交)。问每一条线段可以接到多少水,相对较低的屋顶可以接到高屋顶留下的水(如题图所示)。由于y1!=y2,所以保证屋顶是斜的。
解题思路:
扫描线,因为对于同一个x最多有25条线段,所以不需要线段树更新。
在扫描线的过程中构造出线段与线段之间的关系,好在最后计算每个屋顶可以接多少水。
下面是代码:
#include
#incl...
分类:
其他好文 时间:
2014-08-24 10:19:02
阅读次数:
284
所有的“雨点”最后都可以分解成梯形(三角形就是其中一个底为0),然后lazy标记设置成梯形的上底和下底就好。数目很大,当然要离散化,注意处理点和点之间线段的关系,而且向下更新还有下放标记的时候要注意更新的过程中标记是有可能会变的。#include #include #include #include...
分类:
其他好文 时间:
2014-08-22 22:22:29
阅读次数:
364
Container With Most Water
Given n non-negative integers a1, a2,
..., an, where each represents a point at coordinate (i, ai). n vertical
lines are drawn such that the two endpoints of line...
分类:
移动开发 时间:
2014-08-22 16:17:59
阅读次数:
208
题目链接:Taxi
Taxi
Time Limit: 1 Second
Memory Limit: 32768 KB
As we all know, it often rains suddenly in Hangzhou during summer time.I suffered a heavy rain when I was walking on the s...
分类:
其他好文 时间:
2014-08-16 19:49:11
阅读次数:
234
步进式加热喷射器构及前进机构的电液比例控制回路步进式加热炉要求能无级隧;麓曩节和平稳控制其喷射器构的加(减)速度、前行机构的运行速度以及能按要求可靠地将提。懑机构在升降的任意位置锁定。为了适应提升行程的大控 (1620L/rain),采用了通径52ram的电液比例方向阀。为了确保其位置锁定,采用群....
分类:
其他好文 时间:
2014-08-11 14:50:42
阅读次数:
123
Givennnon-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. 1...
分类:
移动开发 时间:
2014-08-10 01:34:09
阅读次数:
375