Test for JobTime Limit:5000MSMemory Limit:65536KTotal Submissions:9479Accepted:2168DescriptionMr.Dog was fired by his company. In order to support his...
分类:
其他好文 时间:
2015-03-27 23:36:03
阅读次数:
168
题目链接: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 pe...
分类:
其他好文 时间:
2015-03-20 22:02:24
阅读次数:
119
思路:数组中有H个1, N-H个0,按照字典序全排列,注意这里数组可以开int型的也可以开char型的,char型的在这里感觉用起来更方便,至少不要for循环,用char型的数组记得要初始化(memset),或者s[N] = '\0',因为这里有多组数据。
AC代码①:
#include
#include
#include
#include
using namespace st...
分类:
其他好文 时间:
2015-03-20 10:59:41
阅读次数:
169
一, 创建用户:CREATE USER 'dog'@'localhost' IDENTIFIED BY '123456';dog为用户名,localhost为只能本地访问,%表示任意主机都可以访问,或者指定ip访问;123456为此用户的密码;二,授权:GRANT privileges ON dat...
分类:
数据库 时间:
2015-03-18 17:48:22
阅读次数:
189
该题目和求两个字符串的最长公共子串,有相似之处。关键是求得动态规划方程。即f(m,n)= MIN(f(m-1,n-1),f(m-1,n),f(m,n-1)) + 1;f(m,n)表示长度为m的字符串转换为长度为n的字符串所需的最少步骤。f(m,n)递推是通过和最后一个字符串的比较递推得到。存在一个定...
分类:
其他好文 时间:
2015-03-18 01:08:08
阅读次数:
139
A long-distance telephone company charges its customers by the following rules:Making a long-distance call costs a certain amount per minute, dependin...
分类:
其他好文 时间:
2015-03-17 20:09:22
阅读次数:
135
引自:苍梧http://www.cnblogs.com/heaad/archive/2011/03/08/1977733.html在做分类时常常需要估算不同样本之间的相似性度量(Similarity Measurement),这时通常采用的方法就是计算样本间的“距离”(Distance)。采用什么样...
分类:
其他好文 时间:
2015-03-17 11:50:44
阅读次数:
196
广告:#include
int main()
{
puts("转载请注明出处[vmurder]谢谢");
puts("网址:blog.csdn.net/vmurder/article/details/44307489");
}题意&题解http://blog.csdn.net/vmurder/article/details/44302921代码:(同一道题)#in...
分类:
其他好文 时间:
2015-03-16 16:23:33
阅读次数:
157
A gas station has to be built at such a location that the minimum distance between the station and any of the residential housing is as far away as po...
分类:
其他好文 时间:
2015-03-16 12:51:44
阅读次数:
137
10140 - Prime Distance题目链接题意:求[l,r]区间内近期和最远的素数对。思路:素数打表,打到sqrt(Max)就可以,然后利用大的表去筛素数,因为[l, r]最多100W,所以能够去遍历一遍,找出答案。注意1的情况,一開始没推断1,结果WA了代码:#include #incl...
分类:
其他好文 时间:
2015-03-15 21:13:51
阅读次数:
139