码迷,mamicode.com
首页 >  
搜索关键字:numbers range    ( 16974个结果
python中的小技巧
1.求1~100以内的素数prime=filter(lambda x: not [x%i for i in range(2,x) if x%i==0], range(2,101))#列表推导,一行搞定.print prime2.求字符串子串s='hauifnefldmfp'[s[i:i+n] for...
分类:编程语言   时间:2014-07-13 23:39:55    阅读次数:296
C#中定义数组--字符串及数组操作
C#中定义数组--字符串及数组操作一、一维:int[] numbers = new int[]{1,2,3,4,5,6}; //不定长int[] numbers = new int[3]{1,2,3};//定长二、多维int[,] numbers = new int[,]{{1,2,3},{1,2,...
分类:其他好文   时间:2014-07-13 23:06:00    阅读次数:215
Android Google官方文档解析之——Device Compatibility
Android is designed to run on many different types of devices, from phones to tablets and televisions. As a developer, the range of devices provide...
分类:移动开发   时间:2014-07-13 19:49:24    阅读次数:300
Add Two Numbers
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link...
分类:其他好文   时间:2014-07-13 18:20:52    阅读次数:202
DOM 范围折叠要注意的几点
var range = document.createRange(refNode); 1.  调用 range.setEndAfter() 或者  range.setEndBefore() 方法,之前没有调用 setStartAfter(),或者 setStartBefore() 方法,程序会报错。 2. 调用 setStartAfter(),或者 setStartBefore...
分类:其他好文   时间:2014-07-13 16:46:25    阅读次数:135
LeetCode——Triangle
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given the following triangle [ [2], [3,4], [...
分类:其他好文   时间:2014-07-13 16:01:42    阅读次数:209
POJ 3264 Balanced Lineup ST算法
ST算法即是sparse table算法,就是稀疏表的意思,就是利用二分法来划分一个表,划分为2的次方段,之后利用这个st表计算查询结果,可以使得预处理时间O(nlgn),而查询时间为O(1) ; 那么有人会有疑问,既然查询时间是O(1),那么为什么这个算法很多时候并不比线段树快多少,甚至根本没有快过呢? 因为其实查询时间为O(log(range)), range为查询区间的大小,因为...
分类:其他好文   时间:2014-07-12 20:35:55    阅读次数:164
【机器学习算法-python实现】K-means无监督学习实现分类
1.背景        无监督学习的定义就不多说了,不懂得可以google。因为项目需要,需要进行无监督的分类学习。        K-means里面的K指的是将数据分成的份数,基本上用的就是算距离的方法。        大致的思路就是给定一个矩阵,假设K的值是2,也就是分成两个部分,那么我们首先确定两个质心。一开始是找矩阵每一列的最大值max,最小值min,算出range=max-min,然后设...
分类:编程语言   时间:2014-07-12 20:04:16    阅读次数:338
Pku3673
/* B - Cow Multiplication Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status Practice POJ 3673 Description Bessie is tired of multiplying pairs of numbers th...
分类:其他好文   时间:2014-07-12 19:19:02    阅读次数:164
HDU 1016 Prime Ring Problem 题解
Problem Description A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent circles should be a prime...
分类:其他好文   时间:2014-07-12 16:42:15    阅读次数:271
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!