码迷,mamicode.com
首页 >  
搜索关键字:ugly number    ( 27156个结果
poj 1007 DNA Sorting
DNA Sorting Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 80359   Accepted: 32327 Description One measure of ``unsortedness'' in a sequence is the number of ...
分类:其他好文   时间:2014-05-13 23:34:18    阅读次数:303
python中的单元测试
python中的单元测试可以使用doctest,unittest完成 1.doctest的使用 (1)写入程序如下(cubetest.py): #!/usr/bin/python def cube(x): """ cube a number and return the result >>> cube(2) 8 >>> cube(3) 27 >>> cube(4) 64...
分类:编程语言   时间:2014-05-13 23:33:19    阅读次数:491
leetcode第一刷_Valid Number
又是那种看上去非常简单,但非常难过的问题,主要是所有的测试用例很难考虑全面。下面我列举出所有的情况: 1. 字符串前面是可以含有空格的,但是全部都是空格是不行的。 2. 一个数字开头可以是哪些字符呢?很容易想到的是“+”和“-”,但是别忘记还有小数点。 3. 一个数字中间也是可以含有字符的,比如科学计数法的“e”,而且e之后是可以接“+”或者“-”的。但是要注意e是不是作为数字的开头或者结尾...
分类:其他好文   时间:2014-05-13 07:16:48    阅读次数:232
Hydra介绍及使用
Number one of the biggest security holes are passwords, as every password security study shows. Hydra is a parallized login cracker which supports numerous protocols to attack. New modules are easy to...
分类:其他好文   时间:2014-05-13 06:11:08    阅读次数:379
Leetcode 数 Palindrome Number
本文为senlie原创,转载请保留此地址:http://blog.csdn.net/zhengsenlie Palindrome Number  Total Accepted: 12165 Total Submissions: 41736 Determine whether an integer is a palindrome. Do this wit...
分类:其他好文   时间:2014-05-13 05:28:07    阅读次数:253
[leetcode]Minimum Depth of Binary Tree @ Python
原题地址:http://oj.leetcode.com/problems/minimum-depth-of-binary-tree/题意:Given a binary tree, find its minimum depth.The minimum depth is the number of no...
分类:编程语言   时间:2014-05-12 21:55:15    阅读次数:348
HDU 1394 Minimum Inversion Number (数据结构-线段树)
HDU 1394 Minimum Inversion Number (数据结构-线段树) 题目大意: 求逆序数。也就是给你一个序列,每次求逆序数,然再把第一个数放到这个序列的末尾,构成新的序列。问你这n个序列的最小的逆序数。 解题思路: 1、对于每个序列,其原来的逆序数记为 pre , 如果当前把该序列 第一个数 a[0] 移动到尾部,那么新序列的逆序数为 pre-a[i]+(n-a[i]-1) 因为序列中比a[i]大的数有 n-a[i]-1 个,比a[i]小的有 a[i]个。 因此只需求出...
分类:其他好文   时间:2014-05-12 07:07:01    阅读次数:301
【LeetCode】Reverse Nodes in k-Group
Given a linked list, reverse the nodes of a linked listkat a time and return its modified list.If the number of nodes is not a multiple ofkthen left-o...
分类:其他好文   时间:2014-05-11 18:15:52    阅读次数:300
Leetcode 位运算 Single NumberII
本文为senlie原创,转载请保留此地址:http://blog.csdn.net/zhengsenlie Single Number II  Total Accepted: 14224 Total Submissions: 43648 Given an array of integers, every element appears three ti...
分类:其他好文   时间:2014-05-11 03:54:46    阅读次数:317
Leetcode 位运算 Single Number
题意:在一组数组中除一个元素外其它元素都出现两次,找出这个元素 思路:位运算。异或。因为异或操作可以交换元素的顺序,所以元素异或的顺序没影响, 最后出现再次的元素都会被异或掉,相当于0和只出现一次的那个元素异或,结果还是那个元素 推广:这个方法也适合于出现其它元素都出现偶数次,而要找的元素出现奇数次的情况 相关题目:Single Number II class Solution...
分类:其他好文   时间:2014-05-11 02:37:42    阅读次数:397
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!