C -CTime Limit:1000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uSubmitStatusDescriptionGiven a positive integer N, you should output the most ri...
分类:
其他好文 时间:
2015-01-24 20:04:38
阅读次数:
131
原题地址非常有技巧的一道题,如果没有接触过类似题目或没有任何提示的情况下想出来很困难,因为题目要求O(1)的空间复杂度既然是O(1)的空间复杂度,自然要用到原数组了。解法是:1. 遍历每个数组元素,把元素都交换到正确的位置上。比如发现A[3] = 5,则交换A[5]和A[3],让A[5]=5。2. ...
分类:
其他好文 时间:
2015-01-24 17:07:38
阅读次数:
115
A -ATime Limit:1000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uSubmitStatusDescriptionThe least common multiple (LCM) of a set of positive inte...
分类:
其他好文 时间:
2015-01-24 14:28:17
阅读次数:
171
Excel Sheet Column Title2015.1.23 17:20Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -...
分类:
其他好文 时间:
2015-01-23 19:49:35
阅读次数:
144
Problem D - Maximum Product
Time Limit: 1 second
Given a sequence of integers S = {S1, S2, ..., Sn}, you should determine what is the value of the maximum positive product involving cons...
分类:
其他好文 时间:
2015-01-23 18:27:41
阅读次数:
165
Description Ignatius was born in a leap year, so he want to know when he could hold his birthday party. Can you tell him? Given a positive integers Y ...
分类:
其他好文 时间:
2015-01-23 13:16:22
阅读次数:
216
Description The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which flo...
分类:
其他好文 时间:
2015-01-23 12:49:27
阅读次数:
212
Sum of Consecutive Prime NumbersTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 19895Accepted: 10906DescriptionSome positive integers can be ...
分类:
其他好文 时间:
2015-01-22 17:16:21
阅读次数:
177
Number Sequence
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 34582
Accepted: 9929
Description
A single positive integer i is given. Write a program to fin...
分类:
其他好文 时间:
2015-01-22 15:31:18
阅读次数:
109
DescriptionIgnatius was born in a leap year, so he want to know when he could hold his birthday party. Can you tell him?Given a positive integers Y wh...
分类:
其他好文 时间:
2015-01-21 22:20:02
阅读次数:
283