Given an unsorted integer array, find the first missing positive integer.For example,Given[1,2,0]return3,and[3,4,-1,1]return2.Your algorithm should ru...
分类:
其他好文 时间:
2014-07-22 22:52:33
阅读次数:
166
??
Sum of Consecutive Prime Numbers
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 18782
Accepted: 10308
Description
Some positive integers can be represen...
分类:
其他好文 时间:
2014-07-17 19:15:16
阅读次数:
260
1 public class Solution { 2 public int firstMissingPositive(int[] A) { 3 HashSet hash=new HashSet(); 4 int count=0; 5 int...
分类:
其他好文 时间:
2014-07-15 08:58:16
阅读次数:
239
Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d
& %I64u
Submit Status
Description
If a and d are relatively prime positive integers, the arithmetic sequence begin...
分类:
其他好文 时间:
2014-07-13 18:53:13
阅读次数:
251
DescriptionThe Recaman's sequence is defined by a0 = 0 ; for m > 0, am= am?1? m if the rsulting amis positive and not already in the sequence, otherwi...
分类:
其他好文 时间:
2014-07-11 11:12:10
阅读次数:
201
The digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the resulting value contains two or more digits, those digits are summed and the process ...
分类:
其他好文 时间:
2014-07-08 14:12:32
阅读次数:
226
Elevator
Time Limit: 1000ms Memory limit: 32768K 有疑问?点这里^_^
题目描述
The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers de...
分类:
其他好文 时间:
2014-07-06 10:52:11
阅读次数:
188
;; Fermat's Little Theorem:
;; If N is a prime number and A is any positive integer less
;; than N, then A raised to the N-th power is congruent to A modulo N
;; Two numbers are said to be congruent...
分类:
其他好文 时间:
2014-07-06 09:05:22
阅读次数:
158
Given an unsorted integer array, find the first missing positive integer.For example,Given[1,2,0]return3,and[3,4,-1,1]return2.Your algorithm should ru...
分类:
其他好文 时间:
2014-07-05 18:37:04
阅读次数:
188
In this problem you are to generate a triangular wave form according to a specified pair of Amplitude and Frequency.
Input and Output
The input begins with a single positive integer on a line by i...
分类:
其他好文 时间:
2014-07-03 17:15:14
阅读次数:
204