Skip to content

UVa 152

WinDaLex edited this page Sep 15, 2013 · 1 revision

Tree's a Crowd

from Volume 1. Elementary Problem Solving :: Sorting/Searching

Description

在一个三维直角坐标系中, 存在 n 个点。对于某个点, 设离它最近的点的距离为dis。给出所有点的坐标, 要求求出 dis 在1~10以内的点的数量。

Solution

n <= 5000, 时限 3s。直接用 O(n^2) 的暴力,居然过了。

Clone this wiki locally