Problem Description
You are given a sequence of n integers a1 , a2 , ... , an in non-decreasing order. In addition to that, you are given several queries consisting of indices i and j (1 ≤ i ≤ j ≤ ...
分类:
其他好文 时间:
2014-05-07 07:59:11
阅读次数:
309
题目链接:
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1836
Number Puzzle
Time Limit: 2 Seconds Memory Limit: 65536 KB
Given a list of integers (A1, A2, ..., An), and a posi...
分类:
其他好文 时间:
2014-05-07 07:42:49
阅读次数:
332
The gray code is a binary numeral system where two successive values differ in only one bit.
Given a non-negative integer n representing the total number of bits in the code, print the sequence of gr...
分类:
其他好文 时间:
2014-05-07 06:10:17
阅读次数:
370
[Question]
Given an array of integers, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up to t...
分类:
其他好文 时间:
2014-05-07 05:37:44
阅读次数:
278
题目
Given a binary tree, return the preorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
return [1,2,3].
Note: Recursiv...
分类:
其他好文 时间:
2014-05-07 03:30:19
阅读次数:
254
Subtraction Game 1
Chef is playing a game on a sequence of N positive integers, say A1, A2, ... AN. The game is played as follows.
If all the numbers are equal, the game ends.Otherwise
Sele...
分类:
其他好文 时间:
2014-05-07 03:14:01
阅读次数:
280
For a given positive integer n, please find the smallest positive integer x that we can find an integer y such that y^2 = n +x^2.
Input
The first line is an integer T, which is the the...
分类:
其他好文 时间:
2014-05-06 19:21:10
阅读次数:
290
五一中间断了几天,开始继续。。。
1、
??
Copy List with Random Pointer
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.
Return a...
分类:
其他好文 时间:
2014-05-06 18:54:59
阅读次数:
386
【Question】
Given an array S of n integers, are there elements a, b, c in S such
that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.
Note:
Elements in ...
分类:
其他好文 时间:
2014-05-06 14:57:29
阅读次数:
318
1、到今天完成39题,还需要不停的加油。今天再分析下装雨水这道题Given n
non-negative integers representing an elevation map where the width of each bar
is 1, compute how much water i...
分类:
移动开发 时间:
2014-05-06 14:08:48
阅读次数:
490