2017/3/16 22:36:02 Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, t ...
分类:
其他好文 时间:
2017-03-27 00:27:48
阅读次数:
151
Description: Count the number of prime numbers less than a non-negative number, n. 找出小于n的素数个数。 1、用最淳朴的算法果然超时了。 2、埃拉托斯特尼筛法Sieve of Eratosthenes 我们从2开始遍 ...
分类:
编程语言 时间:
2017-03-24 19:05:11
阅读次数:
176
Given a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes. Example: Note: There are at ...
分类:
其他好文 时间:
2017-03-23 23:28:32
阅读次数:
192
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpo ...
分类:
其他好文 时间:
2017-03-21 10:59:56
阅读次数:
133
Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maxim ...
分类:
其他好文 时间:
2017-03-17 22:17:31
阅读次数:
160
523. Continuous Subarray Sum Add to List Given a list of non-negative numbers and a target integer k, write a function to check if the array has a con ...
分类:
其他好文 时间:
2017-03-14 13:39:48
阅读次数:
199
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contai ...
分类:
其他好文 时间:
2017-03-10 17:31:28
阅读次数:
185
Given a list of non negative integers, arrange them such that they form the largest number. For example, given [3, 30, 34, 5, 9], the largest formed n ...
分类:
其他好文 时间:
2017-03-08 22:40:42
阅读次数:
176
传送门 题意:略 论文 《SPFA算法的优化及应用》 http://www.cnblogs.com/lazycal/p/bzoj-2595.html 本题的核心就是求斯坦纳树: Steiner Tree: Given an undirected graph with non-negative edg ...
分类:
其他好文 时间:
2017-03-07 19:01:59
阅读次数:
269
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpo ...
分类:
其他好文 时间:
2017-03-06 23:31:05
阅读次数:
161