码迷,mamicode.com
首页 >  
搜索关键字:number of islands    ( 27069个结果
POJ 1019 Number Sequence 题解
这又是一道看似简单,实际挺困难的题目。 本来想做道基础题消遣一下的,没想到反被消遣了-_-|||。 看个人的基础吧,对于数学好的会简单点,但是由于情况太多,需要都考虑全,故此难度应该在4星以上了。 我这里使用的方法就是直接打表,然后直接模拟,利用打表去掉一大段数据,剩下数据量十分小了,故此可以直接模拟。 打表是为了计算前面的周期数,把周期数直接去掉。 主要难点是后面10位数以上的...
分类:其他好文   时间:2014-07-28 00:02:09    阅读次数:273
LeetCode: Max Points on a Line
LeetCode: Max Points on a LineGiven n points on a 2D plane, find the maximum number of points that lie on the same straight line.地址:https://oj.leetcod...
分类:其他好文   时间:2014-07-27 23:22:59    阅读次数:289
HDU - 1711 Number Sequence
题目来源:http://acm.hdu.edu.cn/showproblem.php?pid=1711 改进的模式匹配算法--KMP算法,时间复杂度有O(n*m)降到O(n+m),求解next数组之后与常规的模式匹配算法相同。 1 #include 2 const int maxn=100...
分类:其他好文   时间:2014-07-27 23:11:29    阅读次数:221
找出数组中出现次数超过一半的元素
题目:找出数组中出现次数超过一半的元素解法:每次删除数组中两个不同的元素,删除后,要查找的那个元素的个数仍然超过删除后的元素总数的一半#include int half_number(int a[], int n){ if( a == NULL || n void find(int a[], ...
分类:其他好文   时间:2014-07-27 23:09:29    阅读次数:169
Understanding Linux /proc/cpuinfo
http://www.richweb.com/cpu_infoA hyperthreaded processor has the same number of function units as an older, non-hyperthreaded processor. It just has t...
分类:系统相关   时间:2014-07-27 22:56:19    阅读次数:518
CodeForces250B——Restoring IPv6(字符串处理)
Restoring IPv6DescriptionAn IPv6-address is a 128-bit number. For convenience, this number is recorded in blocks of 16 bits in hexadecimal record, the...
分类:其他好文   时间:2014-07-27 22:53:39    阅读次数:301
Problem E CodeForces 237C
DescriptionYou've decided to carry out a survey in the theory of prime numbers. Let us remind you that a prime number is a positive integer that has e...
分类:其他好文   时间:2014-07-27 22:51:29    阅读次数:288
CodeForces 237C Primes on Interval
DescriptionYou've decided to carry out a survey in the theory of prime numbers. Let us remind you that a prime number is a positive integer that has e...
分类:其他好文   时间:2014-07-27 22:31:39    阅读次数:809
HDU 1394 Minimum Inversion Number
//============================================================================// Name : B.cpp// Author : L_Ecry// Version :// Copyrigh...
分类:其他好文   时间:2014-07-27 22:20:39    阅读次数:167
实现sqrt()函数
求一个正数N的开方, 并且可以指定精度, 要求不能用库函数sqrt方法一:如下所示,先求sqrt(N)的整数部分,再求小数点后1位,2位 ... ...方法二:牛顿迭代法,根据公式 Ai+1 = (Ai+number/Ai)/2 ,其中Ai 的初始值,即A1任取,如1,2,3 ...// 求一个正数...
分类:其他好文   时间:2014-07-27 22:00:29    阅读次数:251
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!