Air Raid
Problem Description
Consider a town where all the streets are one-way and each street leads from one intersection to another. It is also known that starting from an intersection and wal...
分类:
其他好文 时间:
2014-08-15 21:13:29
阅读次数:
407
This problem can be solve in simpler O(NsqrtN) solution, but I will describe O(NlogN) one.
We will solve this problem in offline. For each x (0?≤?x?n) we
should keep all the queries that end in x...
分类:
其他好文 时间:
2014-08-15 21:11:49
阅读次数:
292
Problem Description
There is a forest can be seen as N * M grid. In this forest, there is some magical fruits, These fruits can provide a lot of energy, Each fruit has its location(Xi, Yi) and the ...
分类:
其他好文 时间:
2014-08-15 14:42:38
阅读次数:
308
784 - Maze ExplorationA maze of rectangular rooms is represented on a two dimensional grid as illustrated in gure 1a.Each point of the grid is ...
分类:
其他好文 时间:
2014-08-15 14:24:48
阅读次数:
176
Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your previous solution stil...
分类:
其他好文 时间:
2014-08-15 12:07:08
阅读次数:
145
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). Find two lines, which together with x-axis forms a container, suc...
分类:
其他好文 时间:
2014-08-15 10:47:38
阅读次数:
255
Description
Stable Grid
Consider a grid of size n x n where each cell contains a number. Let's call a grid stable if we canrearrange the numbers of each row so that every col...
分类:
其他好文 时间:
2014-08-15 10:42:58
阅读次数:
190
In order to reuse the Fragment UI components, you should build each as a completely self-contained, modular component that defines its own layout and behavior. Once you have defined these reusable Fragments, you can associate them with an Activity and conn...
分类:
移动开发 时间:
2014-08-15 01:33:16
阅读次数:
333
DescriptionAssume the coasting is an infinite straight line.Land is in one side of coasting, sea in the other.Each small island is a point locating in...
分类:
其他好文 时间:
2014-08-15 01:28:36
阅读次数:
217
Description
In order to make their sons brave, Jiajia and Wind take them to a big cave. The cave has n rooms, and one-way corridors connecting some rooms. Each time, Wind choose two rooms x and y, an...
分类:
其他好文 时间:
2014-08-15 00:06:46
阅读次数:
331