Digital Roots
时间限制: 1 Sec 内存限制: 128 MB
提交: 91 解决: 29
[提交][状态][论坛]
题目描述
The digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single d...
分类:
其他好文 时间:
2014-05-22 13:01:21
阅读次数:
223
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:
get and set.
get(key) - Get the value (will always be positive) of the key if t...
分类:
其他好文 时间:
2014-05-22 07:25:32
阅读次数:
254
Subsequence
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 8128
Accepted: 3141
Description
A sequence of N positive integers (10 < N < 100 000), each of t...
分类:
其他好文 时间:
2014-05-18 15:26:37
阅读次数:
284
Given an unsorted integer array, find the first
missing positive integer.For example,Given [1,2,0] return 3,and [3,4,-1,1]
return 2.Your algorithm sho...
分类:
其他好文 时间:
2014-05-16 02:58:54
阅读次数:
249
【题目】
A sequence of N positive integers (10 N , each of them less than or equal 10000, and a positive integer S (S <
100 000 000) are given. Write a program to find the minimal length of the subse...
分类:
其他好文 时间:
2014-05-15 07:58:17
阅读次数:
329
未排序数组,O(N)时间,常数空间,这道题让我非常清晰的感觉到算法的魅力。
先想一下如果允许用额外空间的话,我们会怎么做,对,我们会建立一个hash表,然后从头到尾的扫描数组,等等,怎么映射呢?有n个数,要找第一个消失的正正整数,那么这个消失的正整数的取值范围是什么呢?[1, n+1],之所以包含n+1是因为如果这n数正好是连续的前n个自然数。那我们就知道了,开一个长为n的哈希表,如果当前扫到得...
分类:
其他好文 时间:
2014-05-15 03:45:41
阅读次数:
276
JS异常try { var n = prompt("Please enter a
positive number"); var f = factorial(...
分类:
编程语言 时间:
2014-05-14 23:46:00
阅读次数:
405
l and dished out an assist in the Blackhawks' 5-3 win over the Nashville Predators.Shaw said just playing with the Blackhawks was enough motivation for him."Positive,
I'm playing in the NHL," Shaw s...
分类:
其他好文 时间:
2014-05-13 13:46:10
阅读次数:
453
HDU 1061 Rightmost Digit分类: ACM 算法 2011-12-17 17:37
749人阅读 评论(2) 收藏 举报integeroutputinputeach算法c Problem DescriptionGiven a positive
integer N, you sh....
分类:
其他好文 时间:
2014-05-09 10:20:14
阅读次数:
243
2520 is the smallest number that can be divided
by each of the numbers from 1 to 10 without any remainder.What is the smallest
positive number that is...
分类:
其他好文 时间:
2014-05-08 14:36:50
阅读次数:
248