1.题目There are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requirements:Each child must have at least one ca...
分类:
其他好文 时间:
2015-07-29 15:57:18
阅读次数:
149
【053-Maximum Subarray(最大子数组和)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Find the contiguous subarray within an array (containing at least one number) which has the largest sum.
For example, given the ar...
分类:
编程语言 时间:
2015-07-29 07:55:12
阅读次数:
131
链接:http://oj.leetcode.com/problems/lru-cache/
参考:http://www.acmerblog.com/leetcode-lru-cache-lru-5745.html
Design and implement a data structure for Least Recently Used (LRU) cache. It shoul...
分类:
系统相关 时间:
2015-07-28 18:36:30
阅读次数:
174
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:getandset.get(key)- Get the valu...
分类:
系统相关 时间:
2015-07-28 06:39:22
阅读次数:
168
最近在看CF的相关论文,《Collaborative Filtering for Implicit Feedback Datasets》思想很好,很容易理解,但是从目标函数
是如何推导出Xu和Yi的更新公式的推导过程却没有很好的描述,所以下面写一下
推导:
首先对Xu求导:
其中Y是item矩阵,n*f维,每一行是一个item_vec,C^u是n*n维的对角矩阵,
对角线上...
分类:
其他好文 时间:
2015-07-27 21:12:10
阅读次数:
410
我最初以为这是大树乘除法问题,后来发现只是普通的求最小公倍数方法。
原题:
Least Common Multiple
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 38411 Accepted Submissio...
分类:
其他好文 时间:
2015-07-27 19:04:12
阅读次数:
108
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 the...
分类:
系统相关 时间:
2015-07-24 18:31:55
阅读次数:
126
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:getandset.get(key)- Get the valu...
分类:
系统相关 时间:
2015-07-24 17:57:34
阅读次数:
180
Cache这个东西可以说无处不在,处理器中的TLB,Linux系统中的高速页缓存,还有很多人熟知的开源软件memcached,都是cache的一种实现。LRU是Least Recently Used的缩写,即最近最少使用,是常用cache算法中的一种。因为cache的存储空间相对于后端存储来说更有限,将cache空间和后端存储空间映射后,还需要一些算法来解决cache满的问题并保证效率,LRU就是...
分类:
系统相关 时间:
2015-07-23 23:53:10
阅读次数:
226
A natural number, N, that can be written as the sum and product of a given set of at least two natural numbers, {a1, a2, ... , ak}
is called a product-sum number: N = a1 + a2 + ... + ak = a1 × a2 × ...
分类:
其他好文 时间:
2015-07-23 23:48:41
阅读次数:
140