Given a Binary Search Tree (BST) with the root node root, return the minimum difference between the values of any two different nodes in the tree. Exa ...
分类:
编程语言 时间:
2018-11-24 11:48:30
阅读次数:
190
链接:https://codeforces.com/contest/1078 A - Barcelonian Distance - [分类讨论] 题意: 给出一个在二维平面直角坐标系第一象限内的,单位长度为 $1$ 的无限大网格,每条直线都代表道路。又给你一条直线 $ax+by+c=0$,也代表一条 ...
分类:
其他好文 时间:
2018-11-22 02:30:20
阅读次数:
178
题目描述:The task is really simple: given N exits on a highway which forms a simple cycle, you are supposed to tell the shortest distance between any pair... ...
分类:
其他好文 时间:
2018-11-22 02:29:50
阅读次数:
243
题意翻译 大致意思:给定两个整数L,R(1<=L<=R<=2147483648,R-L<=1000000),求闭区间 [L,R]中相邻两个质数的差的最小值和最大值是多少,分别输出这两个质数。 【输入格式】 输入有若干行,每行两个整数 L,R 【输出格式】 对于每个L,R输出最小值和最大值,格式参照样 ...
分类:
其他好文 时间:
2018-11-21 10:21:24
阅读次数:
109
Wireless Network 题目链接:http://poj.org/problem?id=2236 Description: An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) ...
分类:
Web程序 时间:
2018-11-19 22:39:11
阅读次数:
285
题目链接:Barcelonian Distance 题意:给定方格坐标,方格坐标上有两个点A,B和一条直线。规定:直线上沿直线走,否则沿方格走。求A到B的最短距离。 题解:通过直线到达的:A、B两点都有两种方式到直线上,最多4种情况,每种情况求出A、B点到直线的距离和直线上新的两点间距离,取4种情况 ...
分类:
其他好文 时间:
2018-11-19 21:35:52
阅读次数:
247
#include<cstdio>#include<cstring>#define m 300000using namespace std;char a[m];char b[m];int pre0[m];int pre1[m];int main(){ int len1,len2,i; long lon ...
分类:
其他好文 时间:
2018-11-19 21:33:14
阅读次数:
111
这道题,折磨了我一个多小时,前前后后写了三个算法。 The task is really simple: given N exits on a highway which forms a simple cycle, you are supposed to tell the shortest dist ...
分类:
其他好文 时间:
2018-11-18 12:33:04
阅读次数:
225
Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such that the distance between i and j equals ...
分类:
其他好文 时间:
2018-11-16 23:36:25
阅读次数:
199
Spark Java API 计算 Levenshtein 距离 在 "上一篇文章" 中,完成了Spark开发环境的搭建,最终的目标是对用户昵称信息做聚类分析,找出违规的昵称。聚类分析需要一个距离,用来衡量两个昵称之间的相似度。这里采用levenshtein距离。现在就来开始第一个小目标,用Spar ...
分类:
编程语言 时间:
2018-11-16 22:24:07
阅读次数:
212