【题目】Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints...
分类:
其他好文 时间:
2015-05-05 18:28:41
阅读次数:
124
Count PrimesDescription:Count the number of prime numbers less than a non-negative number,nclick to show more hints.References:How Many Primes Are The...
分类:
其他好文 时间:
2015-05-04 21:41:10
阅读次数:
112
Count the number of prime numbers less than a non-negative number, n
一个合数总是可以分解成若干质数的乘积。所以,如果把质数的倍数全都去掉,剩下的就是质数了。
要查找n以内的质数,首先2是质数,把2的倍数:4,6,8…去掉;此时3没有被去掉,可以认为是质数,再被3的倍数去掉;然后再到5,再到7,一直到sqrt(n)。设一个布尔类型...
分类:
其他好文 时间:
2015-05-04 20:15:50
阅读次数:
121
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 num...
分类:
编程语言 时间:
2015-05-03 13:19:22
阅读次数:
181
https://leetcode.com/problems/add-two-numbers/You are given two linked lists representing two non-negative numbers. The digits are stored in reverse o...
分类:
其他好文 时间:
2015-05-03 11:48:50
阅读次数:
122
Description:
Count the number of prime numbers less than a non-negative number, n
References:
How Many Primes Are There?
Sieve of Eratosthenes
题意很简单,求n以内的素数的个数
注意:不包括n
如果注意到refe...
分类:
其他好文 时间:
2015-05-03 10:41:12
阅读次数:
112
Super Sampling Anti-Aliasing
SSAA算是在众多抗锯齿算法中比较昂贵的一种了,年代也比较久远,但是方法比较简单,
主要概括为两步
1. 查找边缘
2. 模糊边缘
这是一种post processing的处理方法,
接下来我们就看看怎么实现
查找边缘
查找边缘的原因也是因为减少消耗,这样就可以只在边缘处进行超级采样,不必为全图进行采样了。...
分类:
编程语言 时间:
2015-05-02 13:56:24
阅读次数:
255
Description:Count the number of prime numbers less than a non-negative number,npublic class Solution { public int countPrimes(int n) { if(n(...
分类:
其他好文 时间:
2015-04-30 23:05:35
阅读次数:
135
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...
分类:
其他好文 时间:
2015-04-30 19:47:00
阅读次数:
100
Count Primes2015.4.30 15:51Count the number of prime numbers less than a non-negative number,nSolution: Sieve of Eratosthenes.Accepted code: 1 // 2CE....
分类:
其他好文 时间:
2015-04-30 17:29:12
阅读次数:
116