码迷,mamicode.com
首页 >  
搜索关键字:water    ( 3290个结果
LeetCode 11 Container With Most Water (C,C++,Java,Python)
Problem: 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 i is at (i, ai) and...
分类:编程语言   时间:2015-05-08 00:05:11    阅读次数:129
Trapping Rain water 诸多细节须注意
Trapping Rain WaterTotal Accepted:35650Total Submissions:118319My SubmissionsQuestionSolutionGivennnon-negative integers representing an elevation map...
分类:移动开发   时间:2015-05-07 00:26:02    阅读次数:249
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 i is at (i, ai) and (i, 0). Fin...
分类:其他好文   时间:2015-05-06 23:10:19    阅读次数:391
[LeetCode] Trapping Rain Water
Trapping Rain Water 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 ...
分类:移动开发   时间:2015-05-06 17:52:41    阅读次数:142
Android 实现图片加水印
加水印代码public Bitmap addWaterMark(Bitmap src, String water, Context context){ Bitmap tarBitmap = src.copy(Config.ARGB_8888, true); int w = tarBitmap.getWidth();...
分类:移动开发   时间:2015-05-06 17:39:48    阅读次数:147
[leetcode] Number of Islands
Number of IslandsGiven 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 con...
分类:其他好文   时间:2015-05-06 10:51:49    阅读次数:132
11-Container With Most Water
【题目】Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints...
分类:其他好文   时间:2015-05-05 18:28:41    阅读次数:124
[LeetCode] Number of Islands
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. You may assume...
分类:其他好文   时间:2015-05-01 20:00:47    阅读次数:136
leetcode042:Trapping Rain Water
问题分析 这道题目解题思路可以参考leetcode011:Container With Most Water 的分析,leetcode011是求围住的最大面积,这里有所区别,统计“装水”面积,还是从两边向中间扫描,时间复杂度O(n)。 这里设置一个水平面h,表示当前围住的高度,如果后续扫面到的比h低,说明可以装水,统计;如果比h高,更新h即可。...
分类:移动开发   时间:2015-04-30 16:14:21    阅读次数:129
Number of Islands
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 ...
分类:其他好文   时间:2015-04-29 11:30:48    阅读次数:132
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!