码迷,mamicode.com
首页 >  
搜索关键字:largest number    ( 27910个结果
Problem Distinct Subsequence
Problem Desciption : Given a stringSand a stringT, count the number of distinct subsequences ofTinS.A subsequence of a string is a new string which is...
分类:其他好文   时间:2014-07-07 19:39:07    阅读次数:206
[Vim] Vim常用基本操作
1. 导航 1.1. 查看行号 :set number 显示行号 :.= 在底部显示当前行号 := 在底部显示总行号 1.2. 移动光标 0 ^ 移动光标到当前行首 $ 移动光标到当前行尾 w 移动到下个单词开头 b 移动到上个单词开头 :0 1G...
分类:其他好文   时间:2014-07-07 18:09:02    阅读次数:153
Distinct Subsequences
题目 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 deleting some...
分类:其他好文   时间:2014-06-30 09:36:18    阅读次数:192
N-Queens II
题目 Follow up for N-Queens problem. Now, instead outputting board configurations, return the total number of distinct solutions. 方法 和上题方法一样,使用回溯法,结构基本相同,只需要返回数量。 public i...
分类:其他好文   时间:2014-06-30 06:24:22    阅读次数:273
Edit Distance
题目 Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.) You have the following 3 operations permitte...
分类:其他好文   时间:2014-06-30 00:46:38    阅读次数:262
Structure and Interpretation of Computer Programs-Exercise 1.3
【问题】 Define a procedure that takes three numbers as arguments and returns the sum of the squares of the two larger numbers. 定义一个过程,它以三个数为参数,返回其中较大的两个数的平方和。 【普通版】 (define (sum-square-largest x y ...
分类:其他好文   时间:2014-06-30 00:19:52    阅读次数:270
【LeetCode】ZigZag Conversion
题目 The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) P A H N A...
分类:其他好文   时间:2014-06-30 00:07:36    阅读次数:268
leetCode: Single Number II [137]
【题目】 Given an array of integers, every element appears three times except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory? 【题意】 给定一个整数以外,其中除了一个整数只出现一次以外...
分类:其他好文   时间:2014-06-29 22:52:35    阅读次数:246
HDU 2824 The Euler function 题解
求区间的euler数值,自然使用筛子法了。 Problem Description The Euler function phi is an important kind of function in number theory, (n) represents the amount of the numbers which are smaller than n and coprim...
分类:其他好文   时间:2014-06-29 22:49:30    阅读次数:303
poj3252-Round Number 组合数学
思路基本上就是组合计数,唯一特别需要注意的是在计算组合数的时候很容易越界,虽然上面分析了计算结果在int范围内是没有问题的,但是计算组合数中间过程还是很可能越界,所以这里要特别注意。解决方法是利用C(n,m)=C(n-1,m-1)+C(n-1,m)进行递归计算,而不是使用传统的乘法计算方式。为了更有效率一点,可以事先计算好n=1~32,m=1~32的组合数的结果然后存起来。...
分类:其他好文   时间:2014-06-29 22:30:04    阅读次数:314
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!