码迷,mamicode.com
首页 >  
搜索关键字:number    ( 26994个结果
JavaScript中typeof知多少?
typeof运算符介 绍:typeof 是一个一元运算,放在一个运算数之前,运算数可以是任意类型。它返回值是一个字符串,该字符串说明运算数的类型。你 知道下面typeof运算的结果吗?typeof(1);typeof(NaN);typeof(Number.MIN_VALUE);typeof(Infi...
分类:编程语言   时间:2015-04-19 17:53:44    阅读次数:138
zoj 3327 Friend Number 贪心
题意:找出比n大的 最小的数,要求每个位上的数字 乘积 与n每个位上的数字 乘积要相等。 参考了别人的题解 做法:如果有0 ,特殊处理。分为末尾只有一个0,不是这种情况。 1、如果只有个位一个0,就从十位上往高位找,找不是9的,找到加1,结束。找的过程遇到9,都改为0。如果都是9,就在数字最左边加一个1。 2、如果有0,且不是上诉情况,那就直接从个位往高位走,遇到9,变0,遇到非9 ,加1,结束。 3、如果没有0的话,把从个位开始,素数分解,并记录所有的素数。分解完一位,就判断下分解出来的素数能不能组...
分类:其他好文   时间:2015-04-19 11:36:23    阅读次数:134
JAVA基础编程50题(25-27题)详解
一、描述 题目1:判断一个数字是否是2的阶次方数,例如8,16,64,256都是2的阶次方数。           题目解析:如果一个数是2的阶次方数,那么这个数字的二进制数的首位为1,后面跟着若干个0,例如8用二进制表示为1000,64为1000000, 如果让这个数减1,然后和这个数做按位&运算即得0,即(number-1)&number==0,8&7=1000&0111=0000。 题...
分类:编程语言   时间:2015-04-19 11:35:08    阅读次数:171
Number of islands
题目:Given a 2d grid map of'1's (land) and'0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjace...
分类:其他好文   时间:2015-04-19 06:27:46    阅读次数:146
Leetcode Bitwise AND of Numbers Range
题目地址:https://leetcode.com/problems/bitwise-and-of-numbers-range/题目解析:参考https://leetcode.com/problems/number-of-1-bits/,我们知道n&n-1为n和n-1两者左边相同的部分,那么容易得到...
分类:其他好文   时间:2015-04-19 01:05:03    阅读次数:316
ZOJ 3327 Friend Number(数学啊 )
ZOJ 3327 Friend Number(数学啊 )...
分类:其他好文   时间:2015-04-18 23:51:14    阅读次数:278
LeetCode (14) Plus One
题目描述Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at the head of the list.使用字符串表示数字,对数字进行“加1”操作,返回结...
分类:其他好文   时间:2015-04-18 23:48:52    阅读次数:208
Javascript手记-基本类型和引用类型
1:ecmascript包含2中不同的数据类型,基本数值类型和引用数值类型.基本数据类型是简单的数据段,引用类型是指那些可能由多个值构成的对象。 1.1:常用的基本类型:Undefined,Null,Boolean,Number,String 1.2:引用类型的值是保存在内存中的对象。与其它语言.....
分类:编程语言   时间:2015-04-18 23:32:17    阅读次数:248
LeetCode (11) Number of 1 Bits
题目描述Write a function that takes an unsigned integer and returns the number of ’1’ bits it has (also known as the Hamming weight).For example, the 32-bit integer ’11’ has binary representation 000000000...
分类:其他好文   时间:2015-04-18 22:02:38    阅读次数:128
NYOJ 427 & HDU 1005 Number Sequence(找循环节)
【题目链接】click here~~ 【题目大意】已经 f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.求f(n), 【解题思路】:此题是大三届的一场比赛题,前几天做了下,结果是不忍直视啊,wa了几乎一页了,最开始想的是用矩阵快速幂,但是想了想,取模数才不到10,7 7=49,也就是说最大结果不超过49种可...
分类:其他好文   时间:2015-04-18 22:02:10    阅读次数:154
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!