Tree Description Give a tree with n vertices,each edge has a length(positive integer less than 1001). Define dist(u,v)=The min distance between node u ...
分类:
其他好文 时间:
2017-12-30 22:40:06
阅读次数:
221
A. Nearest Minimums You are given an array of n integer numbers a0,?a1,?...,?an?-?1. Find the distance between two closest (nearest) minimums in it. I ...
分类:
其他好文 时间:
2017-12-30 00:25:37
阅读次数:
216
Simhash的算法简单的来说就是,从海量文本中快速搜索和已知simhash相差小于k位的simhash集合,这里每个文本都可以用一个simhash值来代表,一个simhash有64bit,相似的文本,64bit也相似,论文中k的经验值为3。该方法的缺点如优点一样明显,主要有两点,对于短文本,k值很 ...
分类:
其他好文 时间:
2017-12-26 14:36:11
阅读次数:
223
https://www.codechef.com/DEC17/problems/CHEFHAM Read problems statements in Vietnamese . Chef likes to work with arrays a lot. Today he has an array A ...
分类:
其他好文 时间:
2017-12-19 01:45:32
阅读次数:
307
Given two strings S and T, determine if they are both one edit distance apart. ...
分类:
其他好文 时间:
2017-12-18 12:05:28
阅读次数:
132
1. 简单例子 步骤 1.1 计算已知点和被求点的距离 1.2 按距离递增排序 1.3 求出距离最近的前k个点的类别最大值作为目标分类 语法解析 a. shape()得到矩阵的各个维度的长度 b. tile,举例 c. sortDistIndices = distance.argsort() 得到排 ...
分类:
编程语言 时间:
2017-12-16 14:54:05
阅读次数:
466
词语相似性比较,最容易想到的就是编辑距离,也叫做Levenshtein Distance算法。在Python中是有现成的模块可以帮助做这个的,不过代码也很简单,我这边就用scala实现了一版。 编辑距离 编辑距离是指一个字符串改编成另一个字符串的最短距离,它描述了两个字符串的相近程度。比如: 因此所 ...
分类:
其他好文 时间:
2017-12-12 21:45:56
阅读次数:
203
题意:给$n$个点$(x_i,y_i)(0\leq x_i\leq w,0\leq y_i\leq h)$,一个点$(x,y)(0\leq x\leq w,0\leq y\leq h)$的美丽值定义为$\sqrt{(x-x_i)^2+(y-y_i)^2}$中的次小值,求最大美丽值 题解的做法是二分答 ...
分类:
其他好文 时间:
2017-12-10 13:18:37
阅读次数:
245
I thought of it as follows, let S(n) be the # of combinationsto go n stepsa) to go n+3 is the S(n+2) + the hop with distance 1 b) to go n+3 is the S(n ...
分类:
其他好文 时间:
2017-12-07 15:19:56
阅读次数:
181
Distance could make you forget about them, but the memories would always be there. 距离会让你遗忘,但是回忆却始终在那里。 Whether you remember it or you forget it, those ...
分类:
其他好文 时间:
2017-12-07 13:30:44
阅读次数:
149