码迷,mamicode.com
首页 >  
搜索关键字:number of islands    ( 27069个结果
ZOJ 3233 Lucky Number --容斥原理
这题被出题人给活活坑了,题目居然理解错了。。哎,不想多说。题意:给两组数,A组为幸运基数,B组为不幸运的基数,问在[low,high]区间内有多少个数:至少被A组中一个数整除,并且不被B中任意一个数整除。|A|#include #include #include #include #define l...
分类:其他好文   时间:2014-07-27 10:06:52    阅读次数:224
hdoj 1492 The number of divisors(约数) about Humble Numbers 【数论】【质因子分解 求和】
定理:一个正整数 n 可以用素因子唯一表示为 p1^r1 * p2^r2 * ... pk^rk (其中 pi 为素数) , 那么这个数的因子的个数就是,(r1+1)*(r2+1)*...*(rk+1). 理解:为什么是加1之后再相乘,因为一个数的的因子数至少为1和他自身,但因为r1,r2。。可以为0,所以因子的个数为(r1+1)。。。 拓展一下: 定理1: 一个正整数 n 可以用素...
分类:其他好文   时间:2014-07-26 15:32:46    阅读次数:194
Leetcode--Combination Sum II
Problem Description: Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. Each number in C may only b...
分类:其他好文   时间:2014-07-26 15:24:02    阅读次数:252
Java杂谈三之判断素数以及穷举素数
首先确认下什么是素数,又称质数 百度的定义解答: 质数(prime number)又称素数,有无限个。一个大于1的自然数,如果除了1和它本身 外,不能被其他自然数整除(除0以外)的数称之为素数(质数) 明确了素数的定义后,下面用java来判断素数以及穷举2-999以内的素数,还是一样,主 要看的是对一个数进行判断或者对一组数进行判断的思想,至于怎样判断的,百度的定义已经给...
分类:编程语言   时间:2014-07-26 15:11:27    阅读次数:238
Javascript高级程序设计学习笔记
3. 基本概念基本数据类型:Undefined,Null,Boolean,Number,String.复杂数据类型:Object.3.6 语句switch比较值时用的是全等运算符 “===” ,因此不会进行类型转换。例如 “10” 不等于10.3.7 函数ECMAScript函数不介意传递进来多少个...
分类:编程语言   时间:2014-07-26 14:58:40    阅读次数:230
Javascript日历
/** *?Created?by?YCXJ-wanglihui?on?2014/7/25. ?*?@module?utils */ ‘use?strict‘; /** ?*?@class?日历类?Calendar ?*?@constructor ?*?@param?{Number}?year ?*?@param?{Number}?mon...
分类:编程语言   时间:2014-07-26 03:36:07    阅读次数:349
HDU4876:ZCC loves cards
Problem Description ZCC loves playing cards. He has n magical cards and each has a number on it. He wants to choose k cards and place them around in any order to form a circle. He can choose any se...
分类:其他好文   时间:2014-07-26 03:02:26    阅读次数:289
[cocos2dx笔记013]一个使用CCRenderTexture创建动态纹理显示数字的类
用CCLabelTTF显示的数字不好看,于是就想到用图片来代理。目前网上的实现都是把每个数字做一个CCSprite组合的方式。但是我想,动态生成纹理的方式。没有就只好自己手动写一个。 头文件 #ifndef _X_NUMBER_H_ #define _X_NUMBER_H_ #include #include namespace cocos2d { //基于图片显示的数字 /* 这...
分类:其他好文   时间:2014-07-26 02:36:56    阅读次数:252
uva10706 - Number Sequence(找规律)
题目:uva10706 - Number Sequence(找规律) 题目大意:有这样一串序列11212312341234512345612345671234567812345678912345678910123456789101112345678910...,问第i个位置数的值。                                                   1 ...
分类:其他好文   时间:2014-07-26 02:27:06    阅读次数:168
Distinct Subsequences
-----QUESTION----- Given a string S and a string T, count the number of distinct subsequences of T in S. A subsequence of a string is a new string which is formed from the original string by...
分类:其他好文   时间:2014-07-26 02:10:36    阅读次数:210
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!