Given a list, rotate the list to the right bykplaces, wherekis non-negative.For example:Given1->2->3->4->5->NULLandk=2,return4->5->1->2->3->NULL.题目关键点...
分类:
其他好文 时间:
2015-03-11 21:24:58
阅读次数:
114
题意:When given an array(a0,a1,a2,?an?1)and an integerK, you are expected to judge whether there is a pair(i,j)(0≤i≤j st;ll ans,K;int n;int T;ll a[10000...
分类:
其他好文 时间:
2015-03-11 21:20:46
阅读次数:
143
Given a list, rotate the list to the right by k places, where k is non-negative. For example: Given 1->2->3->4->5->NULL and k = 2, return 4->5->1->2->...
分类:
其他好文 时间:
2015-03-11 21:15:13
阅读次数:
124
Negative and Positive (NP)Time Limit: 3000/1500 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2177Accepted Submission(...
分类:
其他好文 时间:
2015-03-11 21:13:52
阅读次数:
121
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]...
分类:
移动开发 时间:
2015-03-11 17:22:23
阅读次数:
160
https://leetcode.com/problems/plus-one/Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored suc...
分类:
其他好文 时间:
2015-03-10 21:17:35
阅读次数:
142
题目:大概意思就是给定一个序列a[0],a[1]....a[n-1]和一个整数k,问是否有这样的两个下标是的NP-Sum(i,j)=k,这里NP-Sum(i,j)=a[i]-a[i+1]+a[i+2]-...+(-1)^(j-1)*a[j]。
思路:我们可以维护这个序列的后缀和(前缀也是可以的),然后枚举sum[i]查看在set表中是否存在sum[j]=sum[i]-k。
这里要分成i...
分类:
其他好文 时间:
2015-03-09 22:33:42
阅读次数:
195
Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints of ...
分类:
其他好文 时间:
2015-03-09 22:09:40
阅读次数:
229
PART I: IntegerThere are two types of integer : unsigned integer(only positive) & signed integer(positive,negative and 0)So how does a computer storag...
分类:
移动开发 时间:
2015-03-09 20:45:20
阅读次数:
148
Givennnon-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histog...
分类:
其他好文 时间:
2015-03-09 07:00:12
阅读次数:
178