Time Limit: 1000MSMemory Limit: 65536KTotal Submissions: 22932Accepted: 11567DescriptionDue to recent rains, water has pooled in various places in Far...
分类:
其他好文 时间:
2015-05-24 21:36:11
阅读次数:
98
【题目】 Given a 2d grid map of'1's (land) and'0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adj....
分类:
其他好文 时间:
2015-05-23 16:47:04
阅读次数:
138
for(Shop s:list) { System.out.println(s.getName()); String sql="select shopId,sum(ele_bank+ele_card+water_card+water_bank+coal_c...
分类:
其他好文 时间:
2015-05-21 01:21:35
阅读次数:
152
网址:https://leetcode.com/problems/container-with-most-water/
题意:
找两条纵深线,然后利用x坐标来计算容器面积.
分析:
先找最远的两头,然后往中间收缩,
长变小了,高变长才能使面积可能更大.
所以就是找更长的...
解法:
如果height[left]
反之,同理.
代码:
https://github.com/L...
分类:
其他好文 时间:
2015-05-18 16:43:02
阅读次数:
115
无脑写代码代码(TLE): 1 #include 2 #include 3 4 using namespace std; 5 6 int findLeft(int i, vector height) 7 { 8 int t = i-1; 9 while ((t+1= 0)10 ...
分类:
移动开发 时间:
2015-05-16 17:48:03
阅读次数:
179
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.Fo...
分类:
移动开发 时间:
2015-05-14 18:08:31
阅读次数:
231
题目描述:
Given a 2d grid map of '1's (land) and '0's
(water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. Y...
分类:
其他好文 时间:
2015-05-12 17:13:44
阅读次数:
124
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....
分类:
移动开发 时间:
2015-05-12 01:25:09
阅读次数:
143
一串非负整数,和其序号构成数对(i,v[i]),每条垂直线段的两个端点由(i,0),(i,v[i])两个点构成,两条线段与x轴形成一个容器,求最大容器的储水量。(容器不能倾斜)【思路】1.O(n^2)法:即一个对角线为0的上三角矩阵,求每条线段与其后面的所有线段组成容器的容量(其实就是面积)。该法l...
分类:
其他好文 时间:
2015-05-11 10:39:45
阅读次数:
93
Can you make a water problem?Time Limit:2000/1000MS (Java/Others)Memory Limit:128000/64000KB (Java/Others)SubmitStatisticNext ProblemProblem Descripti...
分类:
其他好文 时间:
2015-05-10 00:57:08
阅读次数:
274