码迷,mamicode.com
首页 >  
搜索关键字:排序 python    ( 180003个结果)
技巧之字符串的简单处理
1)比较字符串比较字符串是指按照字典排序规则,判定两个字符的相对大小。按照字典规则,在一本英文字典中,出现在前面的单词小于出现在后面的单词。在String类中,常用的比较字符串的方法包括Compare、CompareTo、CompareOrdinal以及Equals,下面进行详细介绍。Compare...
分类:其他好文   时间:2014-06-02 21:49:18    阅读次数:418
#排序算法#【4】快速排序
快速排序法是对冒泡排序的一种改进,本来是要和冒泡排序写在一个文章里的,不过前两天刚开始在递归调用的时候没有完全理解,昨天晚上google了一把发现原来自己理解错了,我看的这个教材没有写清楚,今天早上调试了一把终于成功。 快速排序算法的基本思想是:通过一趟排序将要排序的数据分割成独立的两部分,其...
分类:其他好文   时间:2014-06-02 21:03:57    阅读次数:273
projecteuler---->problem=11----Largest product in a grid
In the 2020 grid below, four numbers along a diagonal line have been marked in red. 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 ...
分类:其他好文   时间:2014-06-01 10:04:38    阅读次数:419
HDU2571
昨晚早早跪了,身体太累了,根本吃不消CF了,早上起来继续刷一题!Then,写写python,shell,基本又一天。 题目还是中文题~! 思路:一开始看起来这题目有dfs,但这个矩阵貌似太大了,dfs不敢碰,还是老老实实dp吧,我的做法是,先刷掉最第一列,因为第一列只能从左上往下,then,第i行第j列应该就是dp[i][j]=max(dp[i-1][j],dp[i][k] )+dp[i]...
分类:其他好文   时间:2014-06-01 09:49:34    阅读次数:238
projecteuler---->problem=9----Special Pythagorean triplet
title: A Pythagorean triplet is a set of three natural numbers, a b c, for which, a2 + b2 = c2 For example, 32 + 42 = 9 + 16 = 25 = 52. There exists exactly one Pythagorean triplet for wh...
分类:其他好文   时间:2014-06-01 09:17:53    阅读次数:251
projecteuler---->problem=10----Summation of primes
title: The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two million. 翻译: 10以下的质数的和为2 + 3 + 5 + 7 = 17。 请求出200,0000以下所有质数的和。 import math,time d...
分类:其他好文   时间:2014-06-01 09:12:31    阅读次数:239
projecteuler---->problem=13----Large sum
title: Work out the first ten digits of the sum of the following one-hundred 50-digit numbers. 37107287533902102798797998220837590246510135740250 4637693767749000971264812489697007805041701826053...
分类:其他好文   时间:2014-06-01 08:53:33    阅读次数:276
HDU1872 稳定排序
稳定排序 Time Limit : 3000/1000ms (Java/Other)   Memory Limit : 32768/32768K (Java/Other) Total Submission(s) : 1   Accepted Submission(s) : 1 Font: Times New Roman | Verdana | Georgia Font Size: ← ...
分类:其他好文   时间:2014-06-01 02:44:26    阅读次数:270
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!